Trying to customize my main menu but no luck
-
Hello,
I’ struggling with understanding the concept of custom menus in WP. I have searched and read numerous tutorials, but most seem to be treating much more intricate and difficult topics than the one I’m having.
I have a CSS-class with some styling that I would like to apply to the main menu (and because I know I will use one more navigation later on, and it didn’t seem to add much difficulties, I register one extra menu as well in functions.php.I’ve been reading through and tryied to apply the code from https://codex.www.ads-software.com/Function_Reference/register_nav_menu
https://wordpress.stackexchange.com/questions/32186/how-to-create-a-custom-wordpress-navigation-menu-with-the-code
and https://codex.www.ads-software.com/Navigation_MenusBut my WP doesn’t seem to care at all; my menu is still looking like an unstyled unordered bulleted list.
Here’s my code:
Functions.php:function register_my_menus() { register_nav_menus( array( 'header-menu' => __('Header Menu'), 'extra-menu' => __('Extra Menu') ) ); } add_action('init', 'register_my_menus');
In Header.php:
<div id="navbar"> <?php wp_nav_menu( array( 'theme_location' => 'header-menu' , 'container_class' => 'bmenu' )); ?> </div><!--End div id navbar -->
And the corresponding css (an excerpt, it would be too long with all the different selectors):
.bmenu{ styling...bla bla bla } .bmenu li{ styling... and so on }
Can anyone please help out? I really want to know where I have gone wrong.
- The topic ‘Trying to customize my main menu but no luck’ is closed to new replies.