Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding third and fourth nav menu with mobile dash icons
Tagged: dash icons, menu, mobile, responsive
- This topic has 8 replies, 2 voices, and was last updated 7 years, 10 months ago by oliverrealize.
-
AuthorPosts
-
October 31, 2016 at 5:06 pm #195577oliverrealizeMember
Hi,
I'm working on a site http://newsite.ibew465.org/newwordpress/
I've added a third and fourth menu item but they are not using the responsive dash icons for menu on mobile phones. I will attach my functions.php in a comment so people searching don't have to scroll past the entire code.
I also want to change the word menu on all 3 header menus.
I also want to move the third and fourth menus to the left to match the primary menu.
http://newsite.ibew465.org/newwordpress/October 31, 2016 at 5:06 pm #195578oliverrealizeMemberHere is the functions.php of the child theme. Trimmed to just the parts I added to create third and fourth menu.
//* Adding Third and Fourth Nav Menu function register_additional_menu() { register_nav_menu( 'third-menu' ,__( 'Third Navigation Menu' )); register_nav_menu( 'fourth-menu' ,__( 'Fourth Navigation Menu' )); } add_action( 'init', 'register_additional_menu' ); add_action( 'genesis_after_header', 'add_third_nav_genesis' ); function add_third_nav_genesis() { echo'<div class="nav-primary">'; wp_nav_menu( array( 'theme_location' => 'third-menu', 'container_class' => 'genesis-nav-menu' ) ); echo'</div>'; } add_action( 'genesis_header', 'add_fourth_nav_genesis' ); function add_fourth_nav_genesis() { echo'<div class="nav-primary">'; wp_nav_menu( array( 'theme_location' => 'fourth-menu', 'container_class' => 'genesis-nav-menu' ) ); echo'</div>'; }
November 1, 2016 at 3:54 pm #195612carasmoParticipantThat is not the correct way, you have to register them the Genesis way and do a lot more:
https://amethystwebsitedesign.com/add-third-footer-navigation-menu-to-genesis-child-theme/
November 1, 2016 at 9:13 pm #195625oliverrealizeMemberGiving this a shot right now. Thank You.
November 1, 2016 at 10:21 pm #195626oliverrealizeMemberThe first part of code works fine to register the menus.
But this code below doesn't seem like it's actually adding the menu location. I'm no php expert but I can see that it's not referencing the menus first to apply the array
// Add attributes to markup // Add footer menu just above footer widget area add_action( 'genesis_before_footer', 'amethyst_footer_menu', 9 ); function amethyst_footer_menu() { genesis_nav_menu( array( 'theme_location' => 'footer', 'container' => 'div', 'container_class' => 'wrap', 'menu_class' => 'menu genesis-nav-menu menu-footer', 'depth' => 1 ) ); }
November 2, 2016 at 6:40 am #195634carasmoParticipantYes, it is.The first part adds the theme support and registers with the location 'footer' and then this is the callback, calling the menu you want in the hook in the add_action.
A menu won't show up unless it's assigned, so go to Appearance > Menus and assign a menu to the footer position.
You will save a lot of time taking a course at Knowthecode.io or TeamTreehouse.
November 2, 2016 at 12:54 pm #195640oliverrealizeMemberBut I'm not adding a footer menu. But I still set it up this way to test and it didn't work.
November 2, 2016 at 2:42 pm #195646carasmoParticipantTo test if if works, go over the tutorial again and then assign a menu to the new location.
You can't test if it works or not if you don't actually assign a menu to this new area, nothing will show up if there is no menu there. If you are working with debug off, then you also can't get feedback on whether or not you're coding it correctly. Also, turn off your cache when developing.
November 2, 2016 at 2:52 pm #195647oliverrealizeMemberI've customized the code to get it to work to add what was missing. It is now working. Well at least the menus are now showing I still have to work on the responsive js
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.