-
AuthorPosts
-
October 19, 2014 at 10:48 pm #338040
Greetings wonderful support team!
I need to create two different menus for my site as I build furniture and flutes and want customers to get to two separate “sites” each possibly having a different layout through a portal. I’m providing the link in the Private Content.
I have added the following code to the header.php:<!-- CODE TO INSERT EITHER FLUTES MENU OR FURNITURE MENU INTO THE HEADER --> <?php $args = array(); if (is_page('flutes') ) $args['theme_location'] = 'flutes'; elseif (is_page('tables') ) $args['theme_location'] = 'furniture'; elseif (is_page('seating') ) $args['theme_location'] = 'furniture'; elseif (is_page('lighting') ) $args['theme_location'] = 'furniture'; else $args['theme_location'] = 'furniture'; wp_nav_menu($args);?>
And the following code to the functions.php:
/* * FUNCTION FOR TWO DIFFERENT MENUS */ function register_my_menus() { register_nav_menu( 'furniture', __( 'Furniture Menu') ); register_nav_menu( 'flutes', __( 'Flutes Menu' ) ); } add_action( 'init', 'register_my_menus' );
This code was added to my site after reading the following link as suggestions:
https://wordpress.org/support/topic/is-it-possible-to-have-different-menus-for-different-pagesSo after adding the code it has messed up my menu, of course I can remove the code to return the original menu back, But I want to be able to still have two different menus for Furniture site and Flute site. So the idea is when at the portal (Landing Page) you click on Furniture, you get a menu with lets say: Tables | Seating | Lighting … and whatever else I may add in the future.
And for flutes everything else that you see but without the: Tables | Seating | Lighting and etc.
Also there is the blue link/text menu at the top left corner that has appeared after me adding the code.A working advice is GREATLY appreciated! Thank you!
October 20, 2014 at 9:23 am #338214Hey artemrepin!
Thank you for using Enfold.
Please remove the code then use this plugin to show two different menus: https://wordpress.org/plugins/zen-menu-logic/
Regards,
IsmaelOctober 20, 2014 at 5:03 pm #338458Hi Ismael,
Thank you for the reply. I have installed the plugin and created a custom menu “Furniture” and added pages to it: Tables, Lighting, Seating. I checked the radio buttons on these Furniture Pages for the Zen Menu to put the Furniture Menu there, but it has also replaced the Menu on all the Flute related pages to the Furniture menu since in the Menu Settings we only have the Enfold Main Menu to place the menu into, so the new Custom Furniture Menu replaces the Main Menu (Flutes Menu)Menu Settings
Auto add pages
Automatically add new top-level pages to this menuTheme locations
Enfold Main Menu
Enfold Secondary Menu
(Will be displayed if you selected a header layout that supports a submenu here) (Currently set to: Secondary Menu)
Enfold Footer Menu
(no dropdowns)__________________________________________________
The Following is the New Furniture Menu Structure that I want to show up on the Dedicated PagesMenu Structure
Drag each item into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.
Lighting (Mega Menu) ↑ | ↓ . Menu item 1 of 3.
Seating (Mega Menu) ↑ | ↓ . Menu item 2 of 3.
Tables (Mega Menu) ↑ | ↓ . Menu item 3 of 3.
Menu Settings
Auto add pages
Automatically add new top-level pages to this menuTheme locations
Enfold Main Menu (Currently set to: Flutes Menu)
Enfold Secondary Menu
(Will be displayed if you selected a header layout that supports a submenu here) (Currently set to: Secondary Menu)
Enfold Footer Menu
(no dropdowns)___________________________________________________
And here is the regular Flutes Menu that I want to stay on the Flute related Pages
Menu Structure
Drag each item into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.
How to Play Your Flute Page ↑ | ↓ . Menu item 1 of 7.
Available Flutes Page ↑ | ↓ . Menu item 2 of 7.
Single Chamber Flutes Page ↑ | ↓ . Sub item number 1 under .
Drone Flutes Page ↑ | ↓ . Sub item number 2 under .
Collector’s Edition Flutes Page ↑ | ↓ . Sub item number 3 under .
Custom Flute Shop Page ↑ | ↓ . Menu item 3 of 7.
432Hz Tuning (Mega Menu) ↑ | ↓ . Menu item 4 of 7.
Flute Gallery Page ↑ | ↓ . Menu item 5 of 7.
Our Dealers Page ↑ | ↓ . Menu item 6 of 7.
Cart Page ↑ | ↓ . Menu item 7 of 7.
Menu Settings
Auto add pages
Automatically add new top-level pages to this menuTheme locations
Enfold Main Menu
Enfold Secondary Menu
(Will be displayed if you selected a header layout that supports a submenu here) (Currently set to: Secondary Menu)
Enfold Footer Menu
(no dropdowns)
What should I do?
October 21, 2014 at 7:12 am #338846Hi!
Have you tried to disable the menu as Enfold Main Menu? Please post the login details here. We would like to check it.
Cheers!
IsmaelOctober 21, 2014 at 4:00 pm #339043This reply has been marked as private.October 24, 2014 at 4:58 pm #340698Hello again, am I still being helped or do I need to relist the question again? Please this is urgent!
I have listed my login info in private for moderators to view to help per Ismael’s request…October 25, 2014 at 3:33 am #340869Hi!
Thank you for the info and sorry for the delay but the login credentials are not working. I tried it a few times but it’s really now working. Please check.
Regards,
IsmaelOctober 25, 2014 at 4:25 pm #340972This reply has been marked as private.October 27, 2014 at 9:28 am #341378Hi!
Looks like the Zen Logic Menu plugin is not working. My bad! I can’t see the conditional fields when I activate the main menu. Please use this plugins instead: https://wordpress.org/plugins/menu-items-visibility-control/
I tested this on my installation and it works. Just add conditional functions on the Visibility field (is_page(), is_home()). Please refer to the WordPress codex for conditional functions. For more control over the menu item visibility, add this plugin: https://wordpress.org/plugins/page-specific-menu-items/
Cheers!
IsmaelNovember 10, 2017 at 5:27 pm #875223Hi
I installed the above mentioned plugin “page-specific-menu-items” with wordpress 4.8.3, enfold 4.2. Works fine on desktop version, but not with the mobile Burger menu. There, every menu item is visible. The plugin works with “hide-this-item”. Could it be, that the plugin is not compatible with enfold??Here is the answer of the developper to some other user with the same problem:
“The easy solution would be to add !important at the end of the css declaration. But then it might not work if hide_this_item class is removed by some javascript (that is the major problem with many javascript responsive menu plugins).”
Don’t know, if that helps.
Or any idea? Would appreciate to get a hint for a solution.
Thanks
RenéNovember 12, 2017 at 9:13 pm #875813Hi,
Yes, it seems it can be an issue with the plugin.
Do you please mind contact the plugin developer to help you out and see if there is a conflict?Thank you
Best regards,
BasilisNovember 13, 2017 at 12:15 pm #876066Dear Basilis
Thank you for the quick response.
Could you tell me, if the theme has some javascript which remove „hide_this_item“?
Just to be able to tell the plugin developer that this is not the case.And I think, when he mentioned to add !important at the end of css declaration, he’s talking to css of the plugin, right?
Thank you
RenéNovember 15, 2017 at 5:22 am #876911Hi,
Could you tell me, if the theme has some javascript which remove „hide_this_item“?
Yes, unfortunately, the custom css class attributes is going to be removed when the theme switches to mobile menu in the current script. However, a fix is going to be included in the upcoming patch. Did you add the “hide_this_item” class attribute manually? You can use the nth child css selector instead to hide specific menu items.
Best regards,
IsmaelNovember 16, 2017 at 4:30 pm #877604Hi Ismael
Tought, that could work, but this functions are comin’ from the plugin to add the hide_this_item class:
/** * adds styles to the head of the page in frontend **/ function psmi_hide_menuitems(){ echo '<style type="text/css" media="screen">'; echo '.menu-item.hide_this_item { display: none !important; }'; echo '</style>'; } /** * adds 'hide_this_item' class to each checked menu item **/ function psmi_add_menu_class( $items , $args) { $currentpage_items = get_post_meta(get_queried_object_id(), PSMI_TEXTDOMAIN.'_currentpage_items', true); if (!empty($currentpage_items) && $currentpage_items[0] !=''){ $psmi = Page_Specific_Menu_Items::get_psmi_defaults(); foreach ( $items as $item ) { if ('show'== $psmi['items_defaultview'] && in_array( $item->ID, $currentpage_items ) ) { $item->classes[] = 'hide_this_item '; } if ('hide'== $psmi['items_defaultview'] && !in_array( $item->ID, $currentpage_items ) ) { $item->classes[] = 'hide_this_item '; } } } return $items; }
Tried to replace by the nth child selector, but didn’t work unfortunately.
RenéNovember 17, 2017 at 6:51 am #877957Hi,
Thank you for the info. Which of the menu items have to be hidden on mobile view?
Best regards,
IsmaelNovember 17, 2017 at 10:47 am #878006Hi,
I need to hide the menu items which are checked by the plugin. In the backend, there is the possibility to check the menu items for each page, post etc which should be shown or hide in the frontend.Best regards,
RenéNovember 18, 2017 at 8:30 am #878402Hi,
I’m sorry but I don’t think the plugin is compatible with the theme’s mobile menu. The current mobile menu script will render every menu items regardless of the plugin’s option. Have you tried the other plugin?
// https://wordpress.org/plugins/menu-items-visibility-control/
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.