Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #481707

    Good Evening,

    My client wishes to separate their site into two different sections. I have created two menu’s which link to different pages.

    As an example, one menu is called cars, one menu is called motorcycles. Each of these menu’s have their own links:

    /cars/our-cars
    /cars/our-cars/hatchbacks

    /motorcycles/our-motorcycles
    /motorcycles/our-motorcycles/honda

    Following advice from other threads on this forum, I have also created a child theme, and also copied over /includes/helper-main-menu.php.

    I have copied in code below that I have added to /includes/helper-main-main.php within my child theme for the purposes of identifying the page ID, and outputting the relevant menu. I replaced 'menu_id' =>$avia_menu_class with 'menu_id' => '12', however this does not retrieve either of the menu’s. Any help or advice would be greatly appreciated.

    <div class='container'>
    			      <?php
    			            /*
    			            *	display the themes social media icons, defined in the wordpress backend
    			            *   the avia_social_media_icons function is located in includes/helper-social-media-php
    			            */
    						$nav = "";
    						
    						//display icons
    			            if(strpos( $headerS['header_social'], 'extra_header_active') !== false) echo $icons;
    			            if ( is_page( array(336, 208, 51, 376, 129) ) )
    							{
    							    echo "Cars Menu Required";
    							    /*
    						*	display the main navigation menu
    						*   modify the output in your wordpress admin backend at appearance->menus
    						*/
    						    // $extraOpen = $extraClose = $icon_beside = "";
    						    // if($headerS['header_social'] == 'icon_active_main' && empty($headerS['bottom_menu'])){$icon_beside = " av_menu_icon_beside"; }
    						    // if($headerS['bottom_menu']){ $extraClose = "</div></div><div id='header_main_alternate' class='container_wrap'><div class='container'>";  }
    						
    						    // echo $extraClose;
    						
    						    // echo "<nav class='main_menu' data-selectname='".__('Select a page','avia_framework')."' ".avia_markup_helper(array('context' => 'nav', 'echo' => false)).">";
    						    //     $avia_theme_location = 'avia';
    						    //     $avia_menu_class = $avia_theme_location . '-menu';
    						    //     $args = array(
    						    //         'theme_location'	=> $avia_theme_location,
    						    //         'menu_id' 			=> '12',
    						    //         'menu_class'		=> 'menu av-main-nav',
    						    //         'container_class'	=> $avia_menu_class.' av-main-nav-wrap'.$icon_beside,
    						    //         'fallback_cb' 		=> 'avia_fallback_menu',
    						    //         'walker' 			=> new avia_responsive_mega_menu()
    						    //     );
    						
    						    //     wp_nav_menu($args);
    						
    							}
    							elseif ( is_page( array(338, 372, 374, 376, 380) ) )
    							{
    								echo "Motorcycles Menu Required";
    						/*
    						*	display the main navigation menu
    						*   modify the output in your wordpress admin backend at appearance->menus
    						*/
    						    $extraOpen = $extraClose = $icon_beside = "";
    						    if($headerS['header_social'] == 'icon_active_main' && empty($headerS['bottom_menu'])){$icon_beside = " av_menu_icon_beside"; }
    						    if($headerS['bottom_menu']){ $extraClose = "</div></div><div id='header_main_alternate' class='container_wrap'><div class='container'>";  }
    						
    						    echo $extraClose;
    						
    						    echo "<nav class='main_menu' data-selectname='".__('Select a page','avia_framework')."' ".avia_markup_helper(array('context' => 'nav', 'echo' => false)).">";
    						        $avia_theme_location = 'avia';
    						        $avia_menu_class = $avia_theme_location . '-menu';
    						        $args = array(
    						            'theme_location'	=> $avia_theme_location,
    						            'menu_id' 			=> $avia_menu_class,h
    						            'menu_class'		=> 'menu av-main-nav',
    						            'container_class'	=> $avia_menu_class.' av-main-nav-wrap'.$icon_beside,
    						            'fallback_cb' 		=> 'avia_fallback_menu',
    						            'walker' 			=> new avia_responsive_mega_menu()
    						        );
    						
    						        wp_nav_menu($args);
    							}
    							else 
    							{
    								echo "Whoops, no menu assigned!";
    							}
    						//display navigation
    						if(strpos( $headerS['header_secondary_menu'], 'extra_header_active') !== false )
    						{
    			            	//display the small submenu
    							//CSM commented out
    			            	/*
    			                $avia_theme_location = 'avia2';
    			                $avia_menu_class = $avia_theme_location . '-menu';
    			                $args = array(
    			                    'theme_location'=>$avia_theme_location,
    			                    'menu_id' =>$avia_menu_class,
    			                    'container_class' =>$avia_menu_class,
    			                    'fallback_cb' => '',
    			                    'container'=>'',
    			                    'echo' =>false
    			                );
    			                
    			                $nav = wp_nav_menu($args);
    			                */
    						}
    
    #482016

    Hey csmwebdesign!

    Thank you for using Enfold.

    You can combine the “cars” and “motorcycles” menu items into a single menu then use this plugin to control the visibility of the menu items: https://wordpress.org/plugins/menu-items-visibility-control/

    Regards,
    Ismael

    #482997

    Hi Ismael, thanks for the reply. I have managed to achieve this using the plugin you have mentioned, although this feels like cheating somewhat? I would be really grateful if you could advise how to retrieve the menu based on the ID which I had started in the original post, I’m hoping it wasn’t too far off. Many thanks.

    #483437

    Hey!

    What do you mean by “cheating”? The plugin is specifically made for this kind of menu setup.

    Regards,
    Ismael

    #561289

    seems the plugin is not work on wordpress 4+?

    #561301

    Hey!

    Have you tried using this plugin – https://wordpress.org/plugins/zen-menu-logic/?

    Cheers!
    Yigit

    #561740

    please refer to the website in private,
    can our enfold make this kind of menu function (main menu)

    #562448

    Hi!

    As I understand you need a one page scroll menu right? Yes our Enfold can make this please add a #ID on the page section you want to scroll to and the add the same ID in Appearence > menu > link

    Best regards,
    Vinay

    #653407

    Doen Zen Menu work with Enfold? I just tried it but I can’t get it to fly.

    The location for the menu onöy seem to have one alterantive, and that is Avia?

    /T

    #653428

    Hey!

    Thomas please do create a new ticket and explain us what you need to do, so we can be able to assist you.
    Thanks a lot for your understanding

    Regards,
    Basilis

    #1140301

    Hello….my company just purchased Enfold. I am new to word press and creating my companies site and do not want to break anything in the coding. I have to say I am LOVING Enfold, for a first timer, it is so user friendly and the functionality is fabulous!!!!

    I would love to know what the outcome of this menu issue was. I also would love to have a menu on the home page show certain options only and then on all other pages a different menu with added options.

    Example – home page menu shown: Home – The One Call Process – Kids Corner – Resources – About Us

    Then on all other pages have the menu show other options except for the page they are viewing – as example when they are on the Facility Owners page have the menu only show: Home – The One Call Process – Contractors – Homeowners – Kids Corner – Web Services – Resources – About Us

    then when they are on Contractors page have the menu show: Home – The One Call Process – Facility Owners – Homeowners -Kids Corner – Web Services – Resources – About Us

    I am not saying that the menu titles I listed are set in stone, those are just examples.

    #1140307

    Hi,


    @Oups4740
    We are happy that you like Enfold! :)

    Please try using this plugin – https://eu.wordpress.org/plugins/zen-menu-logic/

    If you have any other questions or issues, please start a thread under Enfold sub forum – https://kriesi.at/support/forum/enfold/#new-post :)

    Best regards,
    Yigit

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Different menu on different pages’ is closed to new replies.