• 0

Menu Swapper plugin does not work with Primary menu


Question

Posted · Report post

I installed menu swapper plugin to display different menus on different pages.

However it does not work for the primary menu. It does work for the simplenav menu though.

After some digging into the code I found that the menu call in the navbar section is missing the 'theme_location' parameter that is used by the plugin.

 

Looks like it's hardcoded somewhere to use the primary-menu navigation.

 

Can you fix this issue?

 

Navbar section code

if ( is_array( wp_get_nav_menu_items( $menu ) ) || has_nav_menu( 'primary' ) ) {
					wp_nav_menu( 
						array(
							'menu_class'		=> 'font-sub navline pldrop ' . $align_class, 
							'menu'				=> $menu,
							'container'			=> null, 
							'container_class'	=> '', 
							'depth'				=> 3, 
							'fallback_cb'		=> ''
						) 
					);

Simplenav section code

		wp_nav_menu( array('menu_class'  => 'inline-list simplenav font-sub', 'theme_location'=>'simple_nav','depth' => 1,  'fallback_cb'=>'simple_nav_fallback') );

Share this post


Link to post
Share on other sites

7 answers to this question

  • 0

Posted · Report post

ochong88

Presently no there isn't a way. However, in 1.2 update you will be able to achieve this with custom fields.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi,

 

I also just this moment tried the Menu Swapper and found it didn't work. I will report this to our tracker.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

any update on this issue?

 

thanks.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

There is currently no update as of this moment. However, this isn't really an issue, its just that the plugin and DMS are not compatible with the NavBar.

It has been reported to our tracker as an enhancement.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

how can i display different menus on different pages with out this plug-in?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thank you Danny. I am going to try Uber Menu. And looking forward to the update. 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

nuovait - Unfortunately, I don't think your request is going to work in the near future anyway. As it will likely require a rewrite of the NavBar and Fixed Navbar. 

However, you will be able to achieve something similar with custom fields in 1.2.

 

ochong88 No problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now