0

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?

1
  • 1
    What 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
    Nov 28, 2020 at 7:36

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.