Community Forums › Forums › Design Tips and Tricks › Removing header on other pages
This topic contains 9 replies, has 5 voices, and was last updated by Webmaster 3 months, 3 weeks ago.
-
AuthorPosts
-
January 22, 2013 at 4:45 pm #13880
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.”
January 22, 2013 at 6:09 pm #13923This 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
January 22, 2013 at 8:32 pm #13960Oh my gosh! Wow, that worked! Thank you so much!
NOW…. what if I want to add a different header on those non-homepage pages? :/
January 22, 2013 at 8:43 pm #13963Oh, wait, actually….. that code is removing the header from the homepage, too. ……
January 23, 2013 at 10:41 am #14069Try this condition instead
if ( ! is_front_page() )
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
February 4, 2013 at 2:56 am #17788Hi, 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
February 4, 2013 at 8:18 am #17835THis is the remove action needed
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
February 4, 2013 at 3:58 pm #18039Thanks 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.
February 8, 2013 at 11:33 am #18960It 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
February 25, 2013 at 2:03 pm #22753If 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).
-
AuthorPosts
You must be logged in to reply to this topic.