Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent header on a page? #53

Closed
daveman321 opened this issue Jul 13, 2017 · 7 comments
Closed

Prevent header on a page? #53

daveman321 opened this issue Jul 13, 2017 · 7 comments

Comments

@daveman321
Copy link

Hi I am using this plugin. how do I prevent header from showing on a page? I want header to show across site except for one page please.

@Nikschavan
Copy link
Collaborator

Nikschavan commented Jul 19, 2017

There is a filter when getting header id which you can use, for now, the usage would be something like this -

function prefix_disable_header_on_page( $header_id ) {

	// Change 1234 to the page ID where you want to disable the header.
	if ( is_page( 1234 ) ) {
		return '';
	}

	return $header_id;
}

add_filter( 'bhf_setting_bb_header_id', 'prefix_disable_header_on_page' );

In the future updates, it would be nice if there is a page level meta option which overrides the global setting.

Related #42

@daveman321
Copy link
Author

daveman321 commented Jul 19, 2017 via email

@daveman321
Copy link
Author

daveman321 commented Jul 20, 2017 via email

@Nikschavan
Copy link
Collaborator

Hello @daveman321,

Yes, you will have to put that code in the functions.php of your child theme.

Also, you will need version 1.1.6-beta.1 that I just updated installed on your site for this to work. You can download that version for here on Github - here

In the future updates, I will try to bring as an option in the page meta so that this can be done very easily.

@daveman321
Copy link
Author

daveman321 commented Oct 24, 2017 via email

@Nikschavan
Copy link
Collaborator

Hello @daveman321,

Yes, although this only for the BB theme, The plugin also supports other themes and for them this will still be required.

@Messa1
Copy link

Messa1 commented Feb 4, 2019

If someone need - I don't like the way over ID so

  1. I copy the beaver builder 'tpl-no-header-footer.php' and
  2. past it in the child theme, rename it to 'tpl-no-header.php'
    3, open the file and change
/*
Template Name: No Header/Footer
Template Post Type: post, page
*/

to

/*
Template Name: No Header
Template Post Type: post, page
*/
  1. save file
  2. open functions.php and add
// No Header
function prefix_disable_header_on_page( $header_id ) {

	if(basename(get_page_template()) === 'tpl-no-header.php'){
		return '';
}

	return $header_id;
}

add_filter( 'bhf_setting_bb_header_id', 'prefix_disable_header_on_page' );

So after that all page with the tpl file 'tpl-no-header.php' will have no header but a footer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants