get_header
Fires before the header template file is loaded.
Description
The hook allows a specific header template file to be used in place of the default header template file. If your file is called header-new.php, you would specify the filename in the hook as get_header( new ).
Parameters (1)
- 0. $name (string)
- Name of the specific header file to use. null for the default header.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'get_header', $name );
- The following example is for adding a hook callback.
- // define the get_header callback
- function action_get_header( $name ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'get_header', 'action_get_header', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'get_header', 'action_get_header', 10, 1 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/general-template.php
- do_action( 'get_header', $name );