-
AuthorPosts
-
September 9, 2014 at 8:42 am #101427
I would like to display different menus on different pages. So for instance if a user was on the home page then they primary menu is rendered as the nav menu at the top of the page. However if they click through to a separate page then I want a different custom menu to be rendered for the main top nav menu.
I can create a custom menu but I can’t work out how to add a specific custom menu to individual pages, or groups of pages.
Your help and guidance here is much appreciated.
(I am using the Renew stack.)
September 9, 2014 at 9:47 am #101476Hi There,
You’ve use an external plugin to do so, http://wordpress.org/plugins/menu-swapper/ which allows you to specify menu per page/post basis. Check it’s video (link in it’s description) to get started.
September 10, 2014 at 5:13 am #101910That plugin was just what I was looking for! Thanks, you guys are awesome.
September 10, 2014 at 5:59 am #101929You’re welcome.
September 25, 2014 at 12:24 am #111999Hello x team ,
Thanx for this question Code Yoda , because i am also going through same issue.
However , the link of the plugin that X team mentioned -> https://wordpress.org/plugins/menu-swapper/ is not compatible upto wordpress version 3.5 , and i m running on version 4 . So how do i make different menus on differnt pages . It would be very nice of X team , if you can suggest me something for this . Thanx in advance 🙂
September 25, 2014 at 2:33 am #112046Hi,
Thanks for writing in.
I just tested that plugin on a test site that runs wp version 4 and xtheme 2.5.1 and didn’t found any issues.
You can try using it if suits your needs.Best Regards.
October 9, 2014 at 10:59 am #122353Hi Suppport,
I found the plugin works great except on the blog and home pages. Do you know why this would be the case? How can I put a different menu on my blog page?
my site: http://www.codeyoda.co.za
Thanks a million.
October 9, 2014 at 5:02 pm #122620Hi again,
Maybe because you’re using a one page navigation that’s why it’s not working on homepage. For the blog page use the metabox to replace existing menu theme locations with your new theme locations.
October 10, 2014 at 9:37 am #123047Thanks for your response, however it works on all other pages, even with 1 page naviagation except the blog page and home pages. Is it possible for you to advise on how to do this manually?
October 10, 2014 at 6:13 pm #123313Hi there,
In that case please provide your admin login credentials in private.
Thanks.
October 14, 2014 at 3:49 am #124741This reply has been marked as private.October 14, 2014 at 10:02 am #124992Hi,
You can do this manually by creating the file _navbar.php in x-child-integrity-light/framework/views/global/
Then copy the code below into that file.
<?php // ============================================================================= // VIEWS/GLOBAL/_NAVBAR.PHP // ----------------------------------------------------------------------------- // Outputs the navbar. // ============================================================================= $navbar_position = x_get_navbar_positioning(); $logo_nav_layout = x_get_logo_navigation_layout(); $is_one_page_nav = x_is_one_page_navigation(); ?> <?php if ( ( $navbar_position == 'static-top' || $navbar_position == 'fixed-top' || $is_one_page_nav ) && $logo_nav_layout == 'stacked' ) : ?> <div class="x-logobar"> <div class="x-logobar-inner"> <div class="x-container-fluid max width"> <?php x_get_view( 'global', '_brand' ); ?> </div> </div> <!-- end .x-logobar-inner --> </div> <!-- end .x-logobar --> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container-fluid max width"> <?php if(is_page( array( 1,2,3,4,5 ) )): ?> <?php wp_nav_menu( array( 'menu' => 'Alternative Nav Menu', 'container' => false, 'menu_class' => 'x-nav sf-menu', ) ); ?> <?php else: ?> <?php x_get_view( 'global', '_nav', 'primary' ); ?> <?php endif; ?> </div> </div> <!-- end .x-navbar-inner --> </div> <!-- end .x-navbar --> </div> <!-- end .x-navbar-wrap --> <?php else : ?> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container-fluid max width"> <?php x_get_view( 'global', '_brand' ); ?> <?php if(is_page( array( 1,2,3,4,5 ) )): ?> <?php wp_nav_menu( array( 'menu' => 'Alternative Nav Menu', 'container' => false, 'menu_class' => 'x-nav sf-menu', ) ); ?> <?php else: ?> <?php x_get_view( 'global', '_nav', 'primary' ); ?> <?php endif; ?> </div> </div> <!-- end .x-navbar-inner --> </div> <!-- end .x-navbar --> </div> <!-- end .x-navbar-wrap --> <?php endif; ?>
Replace 1,2,3,4,5 with page ids where you like your alternative menu to appear.
Here is how to locate page ids.
http://theme.co/x/member/kb/how-to-locate-post-ids/
Hope that helps.
October 15, 2014 at 6:37 am #125595This reply has been marked as private.October 15, 2014 at 1:42 pm #125881Hi there,
Thank you for writing in!
Upon checking, it seems you want to target blog page, in that case, please use the following code instead:
<?php // ============================================================================= // VIEWS/GLOBAL/_NAVBAR.PHP // ----------------------------------------------------------------------------- // Outputs the navbar. // ============================================================================= $navbar_position = x_get_navbar_positioning(); $logo_nav_layout = x_get_logo_navigation_layout(); $is_one_page_nav = x_is_one_page_navigation(); ?> <?php if ( ( $navbar_position == 'static-top' || $navbar_position == 'fixed-top' || $is_one_page_nav ) && $logo_nav_layout == 'stacked' ) : ?> <div class="x-logobar"> <div class="x-logobar-inner"> <div class="x-container-fluid max width"> <?php x_get_view( 'global', '_brand' ); ?> </div> </div> <!-- end .x-logobar-inner --> </div> <!-- end .x-logobar --> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container-fluid max width"> <?php if(is_home()): ?> <?php wp_nav_menu( array( 'menu' => 'Alternative Nav Menu', 'container' => false, 'menu_class' => 'x-nav sf-menu', ) ); ?> <?php else: ?> <?php x_get_view( 'global', '_nav', 'primary' ); ?> <?php endif; ?> </div> </div> <!-- end .x-navbar-inner --> </div> <!-- end .x-navbar --> </div> <!-- end .x-navbar-wrap --> <?php else : ?> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container-fluid max width"> <?php x_get_view( 'global', '_brand' ); ?> <?php if(is_home()): ?> <?php wp_nav_menu( array( 'menu' => 'Alternative Nav Menu', 'container' => false, 'menu_class' => 'x-nav sf-menu', ) ); ?> <?php else: ?> <?php x_get_view( 'global', '_nav', 'primary' ); ?> <?php endif; ?> </div> </div> <!-- end .x-navbar-inner --> </div> <!-- end .x-navbar --> </div> <!-- end .x-navbar-wrap --> <?php endif; ?>
Hope this helps. 🙂
Thank you.
October 16, 2014 at 2:24 am #126158Legends! You guys are awesome – thanks very much. Working perfectly as expected now.
I’ll def be purchasing the X theme again for future website builds 🙂
-
AuthorPosts