Remove after header widget area from landing page

Community Forums Forums Design Tips and Tricks Remove after header widget area from landing page

This topic is: resolved

This topic contains 1 reply, has 2 voices, and was last updated by  braddalton 2 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #39211



    I created an after header widget area using the guidelines provided on brian gardner’s website (the code from my function.php is below).  This after-header widget appears everywhere, except on the home page (as you can see in the code).

    I also created a landing page using Brian Gardner’s guidelines (  This landing page shows the after header widget, but I’d like to remove it from this template.

    Can someone please help me and tell me how I do that?

    Thank you, Laura

    My landing page:

    My theme: magazine

    The code I used to create the after header widget area

    /** Register After Header Widget area **/
    genesis_register_sidebar( array(
    ‘id’ => ‘after-header-widget’,
    ‘name’ => __( ‘After Header Widget’, ‘genesis’ ),
    ‘description’ => __( ‘This is the after header widget.’, ‘magazine’ ),
    ) );

    /** Hook the After Header Widget to the header **/
    add_action (‘genesis_after_header’, ‘custom_after_header_widget’);
    function custom_after_header_widget() {
    genesis_widget_area( ‘after-header-widget’, array(
    ‘before’ => ‘<div class=”after-header-widget widget-area”>’,
    ) );



    The code you pasted above displays the widget content on the home page only.

    To remove the widget output from the landing page you’ll need to add a conditional tag for the landing page template.

    ! is_page_template( ‘page_landing.php’ ) 

    Or add a conditional tag using the page i.d for that page.

    ! is_page (‘007′)


    ! is_page (‘activate-subscription’)

    Can you please link to the source of the custom home page widget code.

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

You must be logged in to reply to this topic.