[Resolved] Child theme header.php not being used on Toolset pages.
This support ticket is created 8 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I am using Toolset with a child theme for Twenty Sixteen with the Toolset Twenty Sixteen integration.
None of my Pages which use Toolset Layouts respect the header.php file in the child theme...nor do they seem to pull the header from the parent theme.
I have a line of code in both parent and child header.php files that is not showing on the pages governed by Toolset Layouts
Pages which do not use a toolset layout (my events) however, do respect the header file.
I can use a function to add my line of code to wp_head. However, this places the code in the wrong spot...i need it to be before all style sheets. ( <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />)
How do I get this below the <head> tag on my Toolset Layout pages?
So apparently, if I put my code in /wp-content/plugins/layouts-twentysixteeen/application/theme/view/header.php I can get it to show on my Toolset pages.
Now, the question is: can that file be moved into my child theme because I don't want the edit overwritten when the plugin is updated?
The WordPress template hierarchy is used to govern which PHP template files are used to build the page (https://developer.wordpress.org/themes/basics/template-hierarchy/), and normally if you want to customise how your pages are constructed that involves editing your theme's template files.
Layouts allows you to do the same without editing the PHP templates, it bypasses the normal WordPress templating system and allows you to build the entire page layout, including header and footer, using drag 'n drop.
So any page that uses Layouts will not use your normal template files.
If you are comfortable editing and making changes to the PHP template files then you may not want to use Layouts at all. You can mix and match, use Layouts on some pages and not others, but where you use Layouts you will need to design the whole page with Layouts, changes you make to header.php won't be recognised.
The header/footer in Layouts just really govern the header/footer that appears on the front end. And unfortunately, my enitre site is built at this point using layouts so I don't want to go back to theme files.
However, I do need a meta tag added to the header.php after the opening <head> tag...and the header.php is in the Toolset TwentySixteen integration plugin.
If you just wanted to make sure a certain meta tag is added to the <head> section of your site then you should probably hook into the wp_head action, and echo your meta tag.
I had tried a function to hook into wp_head, however, my meta tag for IE compatibility mode ended up at the end of all other head code and it needs to be before everything.
Then the only thing I can suggest—other than manually editing the header.php file—is trying the wp_head action with a lower priority (1, or maybe zero, not sure if that is valid) to beat anything else to the punch.