0
I have 2 menus on the Wordpress site that I am developing (top and footer). The problem is that the wp_nav_menu function is only working correctly when placed in header.php. I am registering the menus as follows:
function register_my_menus() {
register_nav_menus(
array(
'header' => __( 'Menu Header' ),
'footer' => __( 'Menu Footer' ),
)
);
}
add_action( 'init', 'register_my_menus' );
and I’m showing off in the header like this:
wp_nav_menu( array( 'theme_location' => 'header','items_wrap' => '<ul class="menu-dinamico">%3$s</ul>' ) );
and on the footer like this:
wp_nav_menu( array( 'theme_location' => 'footer' ) );
Yes, I’ve linked the menus in the wordpress panel. The header works normal, the footer prints a div with a class I’m not even understanding where it comes from.
If I cut the code from the footer.php menu and paste it into header.php it works! Would anyone know why this is happening and how to solve it?