Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #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-pages

    So 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!

    #338214

    Hey 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,
    Ismael

    #338458

    Hi 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 menu

    Theme 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 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.

    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 menu

    Theme 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 menu

    Theme 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?

    #338846

    Hi!

    Have you tried to disable the menu as Enfold Main Menu? Please post the login details here. We would like to check it.

    Cheers!
    Ismael

    #339043
    This reply has been marked as private.
    #340698

    Hello 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…

    #340869

    Hi!

    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,
    Ismael

    #340972
    This reply has been marked as private.
    #341378

    Hi!

    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!
    Ismael

    #875223

    Hi
    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é

    #875813

    Hi,

    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,
    Basilis

    #876066

    Dear 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é

    #876911

    Hi,

    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,
    Ismael

    #877604

    Hi 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é

    #877957

    Hi,

    Thank you for the info. Which of the menu items have to be hidden on mobile view?

    Best regards,
    Ismael

    #878006

    Hi,
    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é

    #878402

    Hi,

    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

Viewing 17 posts - 1 through 17 (of 17 total)
  • You must be logged in to reply to this topic.