Removing header on other pages

Community Forums Forums Design Tips and Tricks Removing header on other pages

This topic is: not resolved

This topic contains 9 replies, has 5 voices, and was last updated by  Webmaster 1 year, 6 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #13880

    sarahsmiley
    Participant
    Post count: 18

    Does anyone know how I can remove the header (from Pretty Pictures theme) on every other page besides the homepage? I just want the header on  “Home.”

    #13923

    SoZo
    Moderator
    Post count: 1573

    This should work

    /** Remove header */
    add_action(‘get_header’, ‘child_remove_header’);
    function child_remove_header() {
    if ( ! is_home() )
    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 );
    }


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #13960

    sarahsmiley
    Participant
    Post count: 18

    Oh my gosh! Wow, that worked! Thank you so much!

    NOW…. what if I want to add a different header on those non-homepage pages? :/

     

    #13963

    sarahsmiley
    Participant
    Post count: 18

    Oh, wait, actually….. that code is removing the header from the homepage, too.  ……

    #14069

    SoZo
    Moderator
    Post count: 1573

    Try this condition instead

    if ( ! is_front_page() )


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #17788

    mynym
    Participant
    Post count: 5

    Hi, I have the same issue: I have quite a large header on the home page, and I want to hide this on all other inner pages (no replacement needed).

    I tried both versions listed above on the website http://www.smart-change-management-camp.com (I copied the code to the function.php), but with no effect (neither on home page nor inner pages)

    I get the result I want if I use firebug, and delete the

    <div id=”header”>

    Section in the code displayed. Thanks for ideas how to achieve that automatically by adding something somewhere ;-)

    #17835

    SoZo
    Moderator
    Post count: 1573

    THis is the remove action needed
    [php]
    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 );[/php]


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #18039

    mynym
    Participant
    Post count: 5

    Thanks for the code, but it does not work. Maybe I enter the code in the wrong place (functions.php)? It has no effect at all, firebug still shows the <div id=”header”> on every single page.

    #18960

    mark.dicker
    Participant
    Post count: 1

    It does work.

    Watch out for the quotes.  When I first copied the code into my functions.php file I didn’t notice my editor wasn’t highlighting the code.  Once i’d replaced the quotes it works like a charm.

    Thanks SoZo.

    Mark

    #22753

    Webmaster
    Participant
    Post count: 63

    If I use the code as provided above (thanks SoZo), the entire page goes to a dark grey background and the posts come out super small (see http://easycaptures.com/fs/uploaded/556/8442074598.jpg). If I remove the priority setting (or change it to the default 10) the home page looks better, but the picture and text are gone (see http://easycaptures.com/fs/uploaded/556/7599545503.jpg). In both instances the “other” posts / pages look as expected (no header and no distortions).

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

You must be logged in to reply to this topic.