Skip to content

How to use wp_nav_menu? #1076

@joaoeduardo

Description

@joaoeduardo

I call wp_nav_menu() inside a function in functions.php file.
Then I call this function on a twig file, but nothing was displayed.
I use WordPress 4.5.2, Timber 1.0.4 installed through wpackagist.

function theme_menu()
{
    wp_nav_menu(array(
        'menu'           => 'primary',
        'theme_location' => 'primary',
        'depth'          => 2,
        'container'      => false,
        'menu_class'     => 'menu__list',
        'fallback_cb'    => 'wp_bootstrap_navwalker::fallback',
        'walker'         => new wp_bootstrap_navwalker()
    ));
}
{{ function('theme_menu') }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions