• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Remove after header widget area from landing page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: resolved

Tagged: landing, magazine, widget

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 4 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 3, 2013 at 11:38 pm #39211
    laura
    Member

    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">',
    ) );
    }

    May 5, 2013 at 3:26 am #39339
    Brad Dalton
    Participant

    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')
    

    or

    ! is_page ('activate-subscription')
    

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


    Tutorials for StudioPress Themes & WooCommerce.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble