Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove site header PHP issue
Tagged: education pro, header, php, remove header
- This topic has 5 replies, 2 voices, and was last updated 9 years, 12 months ago by
Genesis Developer.
-
AuthorPosts
-
February 19, 2015 at 12:11 pm #141336
hmistler
MemberHello - I am trying to remove the site header from a specific page on my website. I am using the Education Pro theme and I did select the "landing page" template, which is supposed to have no header, but the template doesn't seem to be working. I tried to remove the header using php code and while it did remove the site title, tag & logo portion of the header (what normally is in the red box in Education Pro) it still leaves behind a white bar at the top. I thought it might be the navigation bar so I tried to remove that as well with php, but it's still there. Here is the php code I used that is currently getting rid of the site header logo & title area:
//* Remove site header on specific pages add_action('get_header', 'wpsites_remove_header'); /** * @author Brad Dalton - WP Sites * @example http://wpsites.net/web-design/remove-header/ */ function wpsites_remove_header() { if (is_page('6') ) { remove_action( 'genesis_header', 'genesis_do_header' ); } } //* Remove navigation on specific pages add_action('get_header', 'child_remove_genesis_do_nav'); function child_remove_genesis_do_nav() { if (is_page('6')) { remove_action('genesis_after_header', 'genesis_do_nav'); } }
Any ideas on what I need to do to get rid of that white bar? In Firebug it looks like it's part of the site header so I don't know why it's still there. Or better yet, anyone have any ideas why the Landing Page template suddenly won't remove the header? It was working before I added a background image to the site.
http://www.jpdevelopmentcorp.comFebruary 19, 2015 at 12:15 pm #141338Genesis Developer
MemberReplace this
function wpsites_remove_header() { if (is_page('6') ) { remove_action( 'genesis_header', 'genesis_do_header' ); } }
by
function wpsites_remove_header() { if (is_page('6') ) { remove_action( 'genesis_header', 'genesis_header_markup_open', 5 ); remove_action( 'genesis_header', 'genesis_header_markup_close', 15 ); remove_action( 'genesis_header', 'genesis_do_header' ); } }
February 19, 2015 at 12:19 pm #141340hmistler
MemberThat worked, thanks!! Do mind telling me why I needed to add the markup_open and markup_close portions? Just trying to understand php better for future use!
February 19, 2015 at 12:24 pm #141341Genesis Developer
Membergenesis_header_markup_open is creating the
<header>
tag and genesis_header_markup_close is creating</header>
genesis_do_header just creating inner content like logo, title, descriptions etc. So you need to remove the full markup for header bar.
February 19, 2015 at 12:24 pm #141342hmistler
MemberThanks so much, really appreciate it
February 19, 2015 at 12:26 pm #141343Genesis Developer
MemberYou are welcome.
-
AuthorPosts
- The topic ‘Remove site header PHP issue’ is closed to new replies.