container_class isn’t being applied for wp_nav_menu
-
I’m trying to add a wordpress menu to my wordpress theme and when I follow the specified instructions online, it doesn’t work.
I have this in functions.php
<?php function register_my_menus() { register_nav_menus( array( 'header-menu' => __( 'Header Menu' ), 'sidebar-menu' => __( 'Sidebar Menu' ) ) ); } add_action( 'init', 'register_my_menus' );
In sidebar.php of my theme theme I have this code
<?php wp_nav_menu( array( 'theme_location' => 'sidebar-menu', 'container_class' => 'sidebar' ) ); ?>
But when I inspect the HTML code that is outputted, my meny doesn’t have the sidebar class on it, instead it is given a menu class.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘container_class isn’t being applied for wp_nav_menu’ is closed to new replies.