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 1 year, 4 months ago.

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

    laura
    Participant
    Post count: 69

    Hi

    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 (http://www.briangardner.com/create-landing-page/).  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: http://momgoesonline.com/activate-subscription/

    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() {
    if(is_home())
    return;
    genesis_widget_area( ‘after-header-widget’, array(
    ‘before’ => ‘<div class=”after-header-widget widget-area”>’,
    ) );
    }

    #39339

    braddalton
    Participant
    Post count: 9446

    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.
    [php]
    ! is_page_template( ‘page_landing.php’ )
    [/php]

    Or add a conditional tag using the page i.d for that page.
    [php]
    ! is_page (’007′)
    [/php]
    or
    [php]
    ! is_page (‘activate-subscription’)
    [/php]

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


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

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

You must be logged in to reply to this topic.