Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP functions in word press

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28189
    ging
    Member

    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:

    Code:

    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.

    #71157
    john010117
    Member

    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).

    #71749
    ging
    Member

    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.

    "john010117" wrote:
    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).

    I think that file is general-template.php

    Thanks for the reply.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.