• 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

Agency – adding a widget area above 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 › Design Tips and Tricks › Agency – adding a widget area above the header

This topic is: not resolved
  • This topic has 10 replies, 4 voices, and was last updated 12 years ago by weezieb.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • December 9, 2013 at 10:12 am #77839
    carrieoke13
    Participant

    I'm trying to add a widget area above the header in the Agency theme. I've registered the widget in my functions.php file, but I'm stumped on how to actually get it into the header. I tried using Genesis Simple Hooks and putting in the before header area, but it's showing the php code instead of executing the code and showing the widget. Any ideas?

    Thanks!

    Also - I can't link to the site because it's not publicly visible - sorry about that :/

    December 9, 2013 at 10:17 am #77841
    nutsandbolts
    Member

    In general, you need two functions - one to register the widget area and another to tell it where it should show up. Can you paste in what you've been using?


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    December 9, 2013 at 11:06 am #77849
    carrieoke13
    Participant

    Yes - here's what's in my functions.php for Agency:

    
    //* Custom widget above top nav
    genesis_register_sidebar( array(
    	'id'            => 'above-menu',
    	'name'          => __( 'Above Menu', 'agency' ),
    	'description'   => __( 'This is a widget area that can be placed above the top nav menu', 'agency' ),
    ) );

    and here's the code I tried to use in simple hooks:

    
    genesis_widget_area( 'above-menu', array( 'before' => '<div class="above-menu">', 'after' => '</div>',
    

    Thank you!!

    December 9, 2013 at 1:40 pm #77869
    Brad Dalton
    Participant

    It should look more like this in your functions file.

    https://gist.github.com/cbe8a26cacbaeac6bcbc.git


    Tutorials for StudioPress Themes.

    December 9, 2013 at 1:41 pm #77870
    Brad Dalton
    Participant

    It should look more like this in your functions file.

    Change the conditional tag and hook position to suit your needs


    Tutorials for StudioPress Themes.

    December 10, 2013 at 2:43 pm #78145
    carrieoke13
    Participant

    Thank you. I am trying to make this work but I am getting a php error.

    here's what I tried:

    
    genesis_register_sidebar( array(
    	'id'            => 'above-menu',
    	'name'          => __( 'Above Menu', 'agency' ),
    	'description'   => __( 'This is a widget area that can be placed above the top nav menu', 'agency' ),
    ) );
    
     
    add_action( 'genesis_before_header', 'above-menu' );
     
    function your_widget() {
     
    if ( is_front_page() ) {
     
    genesis_widget_area( 'above-menu', array(
     
    'before' => '<div class="above-menu">',
     
    'after'	 => '</div>',
    		
    ) ); 
     
      }
     
    }
    

    and it returned an error. it actually just needs to display on all pages. what should I change?

    December 10, 2013 at 2:47 pm #78147
    carrieoke13
    Participant

    Never mind - I found my mistake! here is what worked. thank you again!

    
    //* Custom widget above top nav
    
    genesis_register_sidebar( array(
    	'id'            => 'above_menu',
    	'name'          => __( 'Above Menu', 'agency' ),
    	'description'   => __( 'This is a widget area that can be placed above the top nav menu', 'agency' ),
    ) );
    
     
    add_action( 'genesis_before_header', 'above_menu' );
     
    function above_menu() {
     
    if ( is_front_page() ) {
     
    genesis_widget_area( 'above_menu', array(
     
    'before' => '<div class="above_menu">',
     
    'after'	 => '</div>',
    		
    ) ); 
     
      }
     
    }
    
    
    December 10, 2013 at 3:17 pm #78165
    Brad Dalton
    Participant

    Please copy the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++ as the scroll bar can hide some code.


    Tutorials for StudioPress Themes.

    January 13, 2014 at 3:39 pm #85055
    weezieb
    Member

    This post was very helpful to me except I'd like this on all pages, not just my front page. Any help on what to change is_front_page to? I can't do just is_page because then it won't work on posts. Or it didn't when I tried.
    Thanks!

    January 13, 2014 at 4:39 pm #85065
    Brad Dalton
    Participant

    Change this line:

    if ( is_front_page() && is_active_sidebar('before-header') 
    

    To this:

    if ( is_active_sidebar('before-header') 
    

    Or remove the entire line.


    Tutorials for StudioPress Themes.

    January 14, 2014 at 9:49 am #85152
    weezieb
    Member

    Thank you so much!

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

© 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