简体   繁体   中英

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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM