• 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

Extra widget under heading not showing on front 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 › Extra widget under heading not showing on front page

This topic is: resolved

Tagged: header widget

  • This topic has 7 replies, 2 voices, and was last updated 11 years, 5 months ago by nunotmp.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • June 29, 2014 at 10:35 am #111984
    ToniLaird
    Member

    Perhaps I closed another post too soon! I added the same code to my live site and the widget shows up in the admin widgets section but nothing displays on the front page. Any ideas?

    http://tonilaird.com/

    genesis_register_sidebar( array(
    ‘id’ => ‘home-feature’,
    ‘name’ => __( ‘Home Feature’, ‘domain’ ),
    ‘description’ => __( ‘Add Content Here’, ‘domain’ ),
    ) );

    add_action( ‘genesis_after_header’, ‘home-feature’ );

    function home-feature() {

    if ( is_front_page() && is_active_sidebar(‘home-feature’) ) {

    genesis_widget_area( ‘home-feature’, array(

    ‘before’ => ‘<div class=”home-feature home-feature”>’,

    ‘after’ => ‘</div>’,

    ) );

    }

    }

    http://tonilaird.com/
    June 29, 2014 at 11:59 am #111993
    nunotmp
    Member

    I am not familiar with with the metro-pro theme but you may need to change your conditional from is_front_page() to is_home


    Genesis Child Themes – Follow Me

    June 29, 2014 at 12:06 pm #111997
    ToniLaird
    Member

    If I do that it will show on every page? I only want this on the front static page. Strange thing is it worked fine on my local server!

    June 29, 2014 at 12:25 pm #111999
    nunotmp
    Member

    If you are using a static front page then yes, you are using the correct conditional. Where are you adding the function? Are you adding it to your functions.php fie?


    Genesis Child Themes – Follow Me

    June 29, 2014 at 12:26 pm #112000
    ToniLaird
    Member

    Hi there

    Yes I added this to my functions.php file. It shows the widget in the admin but when I publish any widget to that position nothing shows.

    June 29, 2014 at 12:39 pm #112004
    nunotmp
    Member

    Try this.

    
    add_action( 'genesis_after_header', 'home_feature' );
    
    function home_feature() {
    
    	if ( is_front_page() ) {
    
    		genesis_widget_area( 'home-feature', array( 
    				'before' => '<div class="home-feature home-feature">',
    				'after' => '</div>',
    			) );
    	}
    
    }
    

    There is are a couple of problems with your code.
    1. add_action( ‘genesis_after_header’, ‘home-feature’ ); You need to use underscores when naming functions instead of hyphens(-).
    2. When using genesis_widget_area you do not need to check is_active_sidebar() genesis does this internally.

    Let me know if this works.


    Genesis Child Themes – Follow Me

    June 29, 2014 at 12:46 pm #112005
    ToniLaird
    Member

    PERFECT thank you. That worked for me. really appreciate your support. 😉

    June 29, 2014 at 12:49 pm #112006
    nunotmp
    Member

    Great! You are welcome. 🙂


    Genesis Child Themes – Follow Me

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 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

© 2025 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