Header.php child theme schema markup

I'm trying to add some scheme markup to the header via the child theme. I'm following examples on this page 


After adding custom fields, it says to put this in your header.php 

I obviously want to do this in my child theme. I didn't have a child theme header.php, so I copied the one from the main be theme directory into the child be theme directory, and then added this code right before the </head> tag
<?php
$schema = get_post_meta(get_the_ID(), 'schema', true);
if(!empty($schema)) {
echo $schema;
}
?>

Viewing the source code for the page, i don't see my changes. Nor does it show up when using the structured data testing tool

Comments

  • Is there a certain place in the header.php that I need to place it? 

    Is there something I need to do to instruct wordpress to use the child theme's header.php?
  • Hi,

    What you ask for, requires files customization what in reference to Item Support Policy is not allowed. So if you want to modify files and don't know how, you should contact with your web developer. Item Policy clearly says:
    Item support does not include services to modify or extend the item beyond the original features, style and functionality described on the item page. For customization services that will help you tailor the item to your specific requirements, we recommend contacting the author to see if they privately offer paid customisation services or checking out the great service providers on Envato Studio

    thanks
Sign In or Register to comment.