-
MaryParticipant
I’m trying to create additional custom navigation menu: https://codex.wordpress.org/Navigation_Menus
but I have a problem because duplicates the class from primary menu. Please help me, I truly need to create an additional with other styles in css.
Daniel TaraKeymasterHere’s a reliable way to add a navigation menu after the slider:
function enlightenment_child_register_secondary_navigation() { register_nav_menu( 'secondary', __( 'Secondary Menu', 'enlightenment' ) ); } add_action( 'after_setup_theme', 'enlightenment_child_register_secondary_navigation' ); function enlightenment_child_secondary_navigation() { if( 'header' != enlightenment_current_sidebar_name() ) { return; } wp_nav_menu(); } add_action( 'get_sidebar', 'enlightenment_child_secondary_navigation' ); function enlightenment_child_secondary_nav_menu_args( $args ) { if( ! doing_action( 'get_sidebar' ) ) { return $args; } $args['theme_location'] = 'secondary'; $args['container_class'] = 'secondary-navigation'; $args['container_id'] = 'secondary-navigation'; $args['walker'] = ''; return $args; } add_action( 'wp_nav_menu_args', 'enlightenment_child_secondary_nav_menu_args', 22 );
Now you’ll have a secondary navigation with a dedicated location and a container class and id of
secondary-navigation
MaryParticipantDaniel, thank you very much for your help! When I added the code to function.php showed me the second menu but when I have set CSS styles does not change anything. Please check this out: http://www.englishcom.eu/
Truly appreciate and thank you for your help.
MaryParticipantDaniel, now it works. I had to clear browsing data… Truly appreciate it and thank you very much for your help! π
MaryParticipantDaniel, Could I ask you again for your help. I want make my secondary navigation menu tree or four columns items (depending on the resolution) I want to use flexbox solution. I have set CSS styles in .secondary-navigation-menu for example: add height: 300px but doesn’t work…
Please check this out: http://www.englishcom.eu/
You must be logged in to reply to this topic.