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

Community Forums Forums Design Tips and Tricks Add widget area after #nav but before #menu-main-menu-1

This topic is: not resolved

This topic contains 2 replies, has 3 voices, and was last updated by  braddalton 2 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #76882

    optimus203
    Participant
    Post count: 22

    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
    #91191

    Susan
    Moderator
    Post count: 9306

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


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #120610

    braddalton
    Participant
    Post count: 10343

    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/


Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.