Last active
February 23, 2017 07:33
-
-
Save Nikschavan/4b69bcee4ef24b2f29d5047e77c80fd1 to your computer and use it in GitHub Desktop.
Change header for particular page - https://wordpress.org/plugins/bb-header-footer/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the dynamic header for a particular page. | |
* | |
* @param String $header_id Page/Template ID of the header set from the options panel. | |
* @return String Page/Template ID of the header after manipulation. | |
*/ | |
function bbhf_header_override( $header_id ) { | |
// Check if the current page id is the page which we want to change the header for, here 1241 is the Id of the page for which I want to have a differennt header. | |
if ( is_singular() && get_the_id() == '1241' ) { | |
// return the ID of the template/page which you want to replace on this page. Here for page with ID 1241 I am overridinng the header with id 30. | |
return '30'; | |
} | |
// As a default return the $id unchanged. | |
return $header_id; | |
} | |
add_filter( 'bhf_setting_bb_header_id', 'bbhf_header_override' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The id of the page/template can be found from like this