Faiz Mohamed Haneef
Faiz Mohamed Haneef

Reputation: 3596

get_header wordpress function invocation

The first line of index.php is get_header(); There is no include / require in my index.php. yet the wordpress site continues to render the head section of home page by referring get_header() from general-template.php

How is wordpress framework achieving this?

Upvotes: 0

Views: 238

Answers (2)

Navelpluisje
Navelpluisje

Reputation: 286

The index.php you're referring to is the index off your theme. Within the root folder of your WP installation also an index.php is located. This is the first one called and starts the whole 'trip'. http://theme.fm/wp-content/uploads/2011/09/wordpress-internals-how-wordpress-boots-up-382x600.png shows an image of the complete file load-sequence.

Upvotes: 0

Davide Brognoli
Davide Brognoli

Reputation: 66

get_header() is a function located in wp-includes/general-template.php.

This function includes the header.php template file from your current theme's directory. If your theme contains no header.php file then this function includes the header file located in wp-includes/theme-compat/header.php.

You can find more information about this function in codex of Wordpress.org

Upvotes: 3

Related Questions