loneil007
-
Posts
8 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by loneil007
-
-
okay, I'll give it a try. Would I replace the code entirely with this below and if I had more page ids to include, do I list via comment? (sorry, Im a newbie):
<?php
if(is_page(14,16,18))
{
wp_nav_menu( array('theme_location' => 'secondary-menu','menu_id' => 'nh-nav','menu_class' => 'sf-menu'));
}
?><?php
if(is_page(13,20,30))
{
wp_nav_menu( array('theme_location' => 'third-menu','menu_id' => 'ma-nav','menu_class' => 'sf-menu'));
}
?><?php
if(is_page(15,30,31))
{
wp_nav_menu( array('theme_location' => 'secondary-menu','menu_id' => 'main-nav','menu_class' => 'sf-menu'));
}
?> -
Okay great. So I updated the code to include different IDs
<?php wp_nav_menu( array('theme_location' => 'primary-menu','menu_id' => 'main-nav','menu_class' => 'sf-menu')); ?><?php wp_nav_menu( array('theme_location' => 'secondary-menu','menu_id' => 'nh-nav','menu_class' => 'sf-menu')); ?><?php wp_nav_menu( array('theme_location' => 'third-menu','menu_id' => 'ma-nav','menu_class' => 'sf-menu')); ?>Now, how do I display only the secondary menu on this page millcityenergy.com/nh? -
Can I change the ID to whatever I want?
-
So this is what I added to my header.php file:
<?php wp_nav_menu( array('theme_location' => 'primary-menu','menu_id' => 'main-nav','menu_class' => 'sf-menu')); ?><?php wp_nav_menu( array('theme_location' => 'secondary-menu','menu_id' => 'main-nav','menu_class' => 'sf-menu')); ?><?php wp_nav_menu( array('theme_location' => 'third-menu','menu_id' => 'main-nav','menu_class' => 'sf-menu')); ?>Could I just replace this entire code with the below?<?php wp_nav_menu( array('theme_location' => 'none','menu_id' => 'main-nav','menu_class' => 'sf-menu','menu'=> get_page_meta( $page->ID, 'MenuName', true))); ?>And update the menu in the custom field on the page level (custom field would be MenuName and in the field enter the name of the menu)? -
This is great @dsonesuk Thank you! I added primary, secondary and third menus. My next question is how I can apply only the primary menu on specific pages, the secondary menu on specific pages, and the third menu on specific pages.
-
@dsonesuk Ahh, I see. So can I just change the id in the code?
-
Hello,
I recently added different menu navigations for specific pages on my site: millcityenergy.com using the wordpress plug-in page specific menu items while it works fine for desktop, the mobile version displays all the pages in the dropdown (select a page). I've tried different custom css codes and as a novice, I have been unsuccessful.
Screenshot attached.
Any idea of how to narrow down the pages and/or follow the same navigation as desktop?
Any help will be greatly appreciated.
Thank you,
Lauren
CSS: Responsive Navigation Menu
in CSS
Posted
Just went back to the conditional tags link and it all makes sense now
I will try this and let you know how it turns out. Thank you very much!