• 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

Add widget area after #nav but before #menu-main-menu-1

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 › Add widget area after #nav but before #menu-main-menu-1

This topic is: not resolved

Tagged: #menu-main-menu-1, nav, widget

  • This topic has 2 replies, 3 voices, and was last updated 11 years, 3 months ago by Brad Dalton.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 3, 2013 at 6:40 pm #76882
    optimus203
    Member

    I would like to add a widget area that sits after div #nav and before ul #menu-main-menu-1 . So it will sit to the right of navigation, but in responsive mode will sit above navigation.

    The code below places the widget area to the right of navigation, but after ul #menu-main-menu-1 - so it doesn't wrap as desired in responsive mode.

    //* Add widget area to right of navigation */
    genesis_register_sidebar( array(
    	'id'          => 'donate_button',
    	'name'        => __( 'Nav Right', 'genesis-sample' ),
    	'description' => __( 'This is after .menu in .nav-primary', 'genesis-sample' ),
    ) );
     
    add_filter( 'genesis_do_nav', 'donate_widget', 10, 2 );
    function donate_widget( $nav_output, $nav ){
    	ob_start();
    	genesis_widget_area( 'donate_button', array(
    		'before' => '<div class="nav-right widget-area">',
    	) );
    	$widget_area = ob_get_clean();
    	return str_replace( $nav, $nav . $widget_area, $nav_output );
    }
    http://n/a
    February 19, 2014 at 11:43 am #91191
    Susan
    Moderator

    @optimus203 - were you able to figure this one out?

    August 23, 2014 at 2:34 am #120610
    Brad Dalton
    Participant

    Not sure if you got this worked out but this may help if you're still interested http://wpsites.net/web-design/nav-menu-widget/


    Tutorials for StudioPress Themes.

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