I would like to add a schema code I have generated to one specific page on my website using functions.php file on my child theme. How do I do this?
-
1What is the schema code - a script to include, or some meta tags to go in the header, or something else? That will determine which hook you need to use. Or you can always create a page-specific template using the slug name or the post ID.Rup– Rup2020-11-28 07:36:29 +00:00Commented Nov 28, 2020 at 7:36
Add a comment
|
1 Answer
Maybe the simplest way is to put your code in a function and call it on that specific page.
if (! function_exists('my_schema_code')) {
function my_schema_code(){
/* schema code... */
}
}
if that page doesnt have a custom file, create one, for example a template or a page. just like Rup said.