I have Menu created by wp_nav_menu. Inside it, I want to set dynamic_sidebar but wp_nav_menu instead of displaying the content, throws 1.

Have everyone some tips for display sidebar inside wp_nav_menu? I have to add dynamic_sidebar inside menu it's important.

Inside walker I placed the code:

$item_output .= '
    <div class="recipes__dropdown">
        <div class="container">
            <div class="dropdown__content">
                <div class="row">' . dynamic_sidebar( 'recipes-dropdown' ) . '</div>

Have you any suggestions how include dynamic sidebar inside wp_nav_menu?


You can add extra items in menu like

add_filter( 'wp_nav_menu_items', 'your_custom_menu_item', 10, 2 );
function your_custom_menu_item ( $items, $args ) {
    if ($args->theme_location == '[YOUR-MENU-LOCATION]') {
        $items .= '--YOUR EXTRA STUFF HERE--';
    return $items;

Hope it will help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.