Skip to content

Instantly share code, notes, and snippets.

@Nikschavan
Last active February 23, 2017 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nikschavan/4b69bcee4ef24b2f29d5047e77c80fd1 to your computer and use it in GitHub Desktop.
Save Nikschavan/4b69bcee4ef24b2f29d5047e77c80fd1 to your computer and use it in GitHub Desktop.
Change header for particular page - https://wordpress.org/plugins/bb-header-footer/
<?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' );
@Nikschavan
Copy link
Author

The id of the page/template can be found from like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment