- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I am setting up a basic php framework to use as a basic starter for the websites I do. Mostly to have the same place to start from but I want to learn more about PHP then I do. The best way for me is doing.
I had a question about how WordPress had it’s functions available to any page and there isn’t an includes(); function at the beginning of the pages.
I have my index.php set up as this calling the functions for to include different functions on the page:
I notice that in WordPress there is never a need to do the first includes(); function. How are all the functions available without that. Probably a very newbie question but I’d like to get my head around it.
Look in wp-includes/functions.php file – the get_header(), get_footer(), etc. functions all utilize include() (or require/require_once() – I can’t remember).
When you browse to a wordpress site it calls the root index.php which in turn requires and includes all the functionality that wordpress uses and then calls the index.php file in the active template.
I was just working in the template and I thought there might be another way I was able to access the WP functions. As I didn’t see any include() or require() bringing in function libraries. Until I looked beyond the template and to how the template index.php files was called.
I think that file is general-template.php
Thanks for the reply.