Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Does WordPress run the Child Theme functions.php file first? If it does, the ‘register_default_headers’ function won’t have been ran yet from the parent theme http://themes.svn.wordpress.org/twentyseventeen/1.4/inc/custom-header.php
Do you need to use the ‘after_setup_theme’ hook? https://codex.wordpress.org/Plugin_API/Action_Reference/after_setup_theme
@anevis
Thanks for your reply. Unfortunately that runs over my head…
There is a function called unregister_deafult_headers()
How can I use it?
Yes, it must be called after the register_deafult_headers()
I’m not sure how… Is there another hook?
Any help is much appreciated. Thanks.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
My bad, you can ignore what I meant above because you’re already doing it.
The only other suggestion would be to check the order of that ‘after_setup_theme’ hook. As the order is not explicitly set in the parent theme, try installing this plugin to see if it exposes the order: https://wordpress.org/plugins/debug-bar-actions-and-filters-addon/
@anevis
Thanks for the suggestion.
The function that’s registerring the default headers has priority 10.
What am I missing? Am I using the wrong key? It seems to be registered as ‘deafult-image’
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Yea I don’t see what’s wrong too, other than the priority number. How did you get to “10” as the priority when the parent theme doesn’t set the priority on its ‘register_default_headers’ function?
@anevis
How?? I installed the plugin you told me to…
It says the parent theme function has prio 10 and my function has prio 11.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Okay great, I didn’t know you installed the plugin. I’ll wait for someone else to respond who has more knowledge.
@anevins
Thanks for your advice.
I’m not sure but it seems like TwentySeventeen doesn’t follow codex.
So much pain working with it… 🙁