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 1 reply, has 2 voices, and was last updated by  Susan 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 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: 8587

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


    Susan @ Graphically Designing I’d love to customize your website! I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

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

You must be logged in to reply to this topic.