• 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

First timer – trying to add a widget area *before* another one inside the header

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 › General Discussion › First timer – trying to add a widget area *before* another one inside the header

This topic is: not resolved
  • This topic has 3 replies, 2 voices, and was last updated 11 years, 9 months ago by Lauren @ OnceCoupled.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • October 27, 2014 at 6:26 pm #129499
    jfraser
    Member

    I'm using the minimum theme and want to place a "upper-right-header widget-area" and eventually a "middle-header widget-area above the menu for social icons and a few other things. I understand (marginally) the registration of the layer and the inclusion of the layer based on a hook. So I have the following code thus far:

    //* Register after post widget area
    genesis_register_sidebar( array(
    	'id'          => 'upper-header',
    	'name'        => __( 'Upper Header', 'minimum' ),
    	'description' => __( 'This is the upper header section.', 'minimum' ),
    ) );
    
    //* Hook inside header for upper header
    add_action( 'genesis_header', 'sp_upper_header_widget' );
    	function sp_upper_header_widget() {
    		genesis_widget_area( 'upper-header', array(
    			'before' => '<div class="upper-header widget-area">',
    			'after' => '</div>',
    	) );
    }

    What it does is place the new widget area in the header but right below the menu in the header right widget.

    How do I modify the code above to say "inside the genesis_header" but before the "header right widget"?

    Thanks in advance for the help!

    October 27, 2014 at 7:27 pm #129505
    Lauren @ OnceCoupled
    Member

    For that you (probably - can't check without a link to your site) need hook priority. 🙂 Use the following line just as you had it originally, but add a new parameter to it:

    add_action( 'genesis_header', 'sp_upper_header_widget' );

    becomes

    add_action( 'genesis_header', 'sp_upper_header_widget', 9 );

    The default priority is 10, and then they're placed in the order they are read in. So adding a 9 will move it up in the queue. You can decrease the number as needed, but if you're all the way down at 1 and it isn't working, it's the hook location itself that needs adjusting!

    Cheers,
    Lauren


    We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com

    October 27, 2014 at 7:28 pm #129506
    jfraser
    Member

    Beautiful! hook priority; what a concept! - working perfectly!

    Exactly what I needed. THanks for the prompt reply!

    October 28, 2014 at 5:48 am #129546
    Lauren @ OnceCoupled
    Member

    Absolutely! Glad to be sharing something new. 🙂


    We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ 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

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