html - WordPress : Genesis Framework Custom Nav CSS Class -


I am using a custom custom theme with the Genesis Framework.

I am not trying to change the default menu with my own, I only want to add the name of a custom class to the existing element, which currently displays header (Header from my menu is in the widget)

How can I achieve it? I have tried to use the nav_menu_css_class filter without success in my child's function.php file.

From the menu menu that will be created in WordPress, the first menu name will be applied as follows. So if you have a menu with the top menus name, then that UI will be a menu-top-menu, so that ul is this and lt; Ul id = "menu-top-menu" class = "menu" . You can target the menu using ID.

Alternatively, if you create a menu called 'Top Menu', then you can call it directly in the theme file using the wp_nav_menu . Using this technique, you can add a class. In the example below I'm adding a class named "code" to the top-menu . Wp_nav_menu (array ('menu' = & gt; top menu ',' menu_class '= & gt; top-menu'));


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -