Tjarls.com
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How does get_header() get the header.php template? – Detailed PHPAh I see. You’ve really been a great help, thank you.
Now, I do have a final question.
It’s about the get_header action.When ´do_action(get_header)´ is called, what actually happens? or does anything really happen?
´do_action( ‘get_header’, $name );´
So far the only thing I’ve been able to conclude is that the get_header action is used to run functions before the header template is loaded.
Does it have any other uses or is it just a means to add functions before the header is loaded?Forum: Fixing WordPress
In reply to: How does get_header() get the header.php template? – Detailed PHPThank you very much for the response 🙂
This does make some sense now, but this leads me to a new question.
When the function
locate_template()is called$loadis defined as being trueif ('' == locate_template($templates, true)) load_template( get_theme_root() . '/default/header.php');but in
locate_template()it seams thatload_template()is only being called if the string in$locatedis not empty and equal to$loadif ($load && '' != $located) load_template($located);but the fact that
$locatedis not empty should mean that it is being returned as ‘true’ right? and since$loadis defined as true when the function is first called i don’t see how it can load the template.Did i read this wrong? or am i missing something? Really hope you can help me.
again, thanks in advance.