Remove Header on Specific Pages

Community Forums Forums Design Tips and Tricks Remove Header on Specific Pages

This topic is: not resolved

This topic contains 3 replies, has 3 voices, and was last updated by  Susan 1 year, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7167

    Mack
    Participant
    Post count: 31

    My Client wants me to remove the header on specific “Lifestyle Pink” pages.
    How can I achieve this requirement?

    Thanks in advance for any support you can offer to meet this requirement.

    Mack

     

    #7180

    Susan
    Moderator
    Post count: 9254

    Try adding this to your stylesheet (replacing the “2″ with your page ID):

    .page-id-2 #header { display: none; }


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #7192

    Brian Bourn
    Participant
    Post count: 98

    You can create a page template called page-noheader.php and add it to your child theme folder and use the following in it:

    <?php
    /*
    Template Name: Page No Header
    */
    
    //***Add Custom Body Class**/
    add_filter( 'body_class', 'no_header_body_class' );
    function no_header_body_class( $classes ) {
       $classes[] = 'page-no-header';
       return $classes;
    }
    
    //***Remove Header**/
    remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
    remove_action( 'genesis_header', 'genesis_do_header' );
    remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
    
    genesis();
    

    This will make it a selectable template from the page editor and add a body class so you can target it with CSS as things will probably need adjusting after you remove the header.


    Bourn Creative | bourncreative.com | Twitter

    #7195

    Susan
    Moderator
    Post count: 9254

    Thanks for this suggestion, Brian! I agree about perhaps wanting to change things on those pages where a header is removed – before making my own suggestion, I tested it on my own test side, and I think the page needed something to replace the missing header!


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.