Solved

Wordpress Change Order Of Nav Menu

Posted on 2013-05-23
2
564 Views
Last Modified: 2013-06-10
I'm assisting a nonprofit with their Wordpress website after their previous designer exited the building and I'm trying to figure out what is preventing me from changing the order of the main navigation menus. Using the Page ordering of the main pages of each menu with the 1,2,3,4,5,6 etc. does not work. Trying to adjust them in the Appearanace -> Menus settings does not work, as the theme says it supports 0 menus, and so far I am stumped.

Site: http://www.petalumaartscenter.org

Not sure if something in the custom code is overriding everything else but if anyone can help me solve this riddle that would be most appreciated.

Thanks!
0
Comment
Question by:telstar_
2 Comments
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 250 total points
ID: 39193472
Not sure if something in the custom code is overriding everything else

Probably.  Check the header.php for the theme to see how the menus are being generated and if the previous designer used a WordPress function, the Codex will tell you how to alter it to have your preferred order.
0
 
LVL 4

Accepted Solution

by:
Ahmed Hussein earned 250 total points
ID: 39201201
Try to register the menu like that:

register_nav_menus( array(
	'header_menu' => 'Header Navigation Bar'
) );

Open in new window

Than in the header.php file replace the existing nav bar code with:

<?php

$defaults = array(
	'theme_location'  => '',
	'menu'            => 'header_menu',
	'container'       => 'div',
	'container_class' => '',
	'container_id'    => '',
	'menu_class'      => 'menu',
	'menu_id'         => '',
	'echo'            => true,
	'fallback_cb'     => 'wp_page_menu',
	'before'          => '',
	'after'           => '',
	'link_before'     => '',
	'link_after'      => '',
	'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
	'depth'           => 0,
	'walker'          => ''
);

wp_nav_menu( $defaults );

?>

Open in new window


This will return a <ul> containing a list of the links and pages you added from Appearance -> Menus.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article discusses how to create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now