(v9.7.3 with child theme): modified header.php from child theme not loaded

Posted in: Newspaper
Post count: 7

Hi,
issue: my child HEADER.php seems not to be loaded

I am using newspaper v 9.7.3 and the child theme. I copied the theme’s HEADER.php to the child theme folder.
Then I added some stuff in the <head> section, just scripts and links.
In the previous version all worked, but since the update from 9.7.2. to 9.7.3 my child HEADER.php seems not to be loaded.
My script and links do not appear when the page is rendered.

Maybe because of the first few lines in that header file?:
php code in the first few lines:
do_action(‘tdc_header’)
if (has_action (‘tdc_header’)){return}

If I delete that code … my modified header file is apparently loaded … but the page is not rendered correctly any more (e.g. the logo is missing). So, I am stuck here.

What does that php code do? First registering an action and then returning if it is registered? Maybe something to look into?
HAS ANYBODY used the child theme with a modified header.php file.
Best regards
Frank

Post count: 35449

Hi,

Most of the theme files were moved into the tagdiv composer plugin as per the requirements of envato: https://help.author.envato.com/hc/en-us/articles/360000472383-WordPress-Theme-Requirements.
We wrote an article on the subject here: https://tagdiv.com/updating-the-core-of-tagdiv-themes/
Moving forward with such requirements, a child theme will only work with functions.php, and style.css as there are very few files left in the main theme as envato requires all functionality to be added through plugins.

Please check this topic about the update to the Newspaper 9.7 -> https://forum.tagdiv.com/topic/important-new-update-newspaper-9-7/

Thank you!

Post count: 7

Thanks, Calin, for clarifying — in my case my work-around is to add the script and link-tags into Newspaper’s theme panel section for Google Analytics / script code. I am happy that also link tags work in that section and aren’t filtered out.
Suggestion: May be that section title should be not specific to Google Analytics?: may be something like “Script, meta, link etc tags for the head section”? And for the footer area, of course.

Not that I have need right now for changing more in the header php file… but would there be a way to do so in the future? How does Envato’s requirement go along with WP child theme concept?

Thanks
Frank

Post count: 35449

Hi,

I can note your suggestion on our suggestions list.

According to the envato requirements for child theme -> https://www.screencast.com/t/JkRUP9LI -> https://help.author.envato.com/hc/en-us/articles/360000480723-WordPress-Theme-Feature-Requirements#h_5966589781211522283728890

Thank you!

Post count: 7

Hi Calin,

yes, I read through the WP codex Child themes section (https://developer.wordpress.org/themes/advanced-topics/child-themes/) and it seems still the old way: I could potentially copy the header.php file from the parent theme (let’s say in our case: Newspaper) and could modify header.php.

My question is: After the change from Newspaper v9.7.2. to v9.7.3 that doesn’t seem to work anymore, at least not without removing the first few code lines from header.php where tdc_header is called.
It seems that everything after that code in header.php is ignored? Is that correct?
If so, how would I make a child theme’s header.php work in Newspaper? Eliminating the call for tdc_header doesn’t do it because, as you said, all the functionality had been moved to the tagdiv composer plugin.
In v9.7.2 it was not a problem to make changes to header.php — in v9.7.3 it seems difficult — any pointer how to make a child theme’s header.php or footer.php work?

Thanks,
Frank

Post count: 35449

Hi,

Yes, the header.php is overwrite by the tdc_header.php that can be find in wp-content/plugins/td-composer/includes/panel/tdc_header.php this is working in this way because was inserted the header manager that need to be implemented using tagDiv Composer and tagDiv Cloud Library.

Thank you!

Post count: 7

Thanks for explaining, Calin!
Cheers,
Frank

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.