Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

Nikschavan commented Feb 23, 2017

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
You can’t perform that action at this time.