I am newbie in web development. I am discovering wordpress templates now. They all have similar structure. But I have noticed one interesting thing for me.
There are function calls in php template files. Like get_header(), get_footer(). But I don't understand how does PHP interpreter know about this functions, there are not any includes,requires ....
How does this work, please explain this. I would be very grateful for any help.
Take a look at the files starting with index.php in the Wordpress folder, which is the first file that get's loaded. You will see "require( dirname( __FILE__ ) . '/wp-blog-header.php' );", and that's just the beginning.
So to answer your question, wordpress uses "require" to include files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With