Solved

Wordpress Change Order Of Nav Menu

Posted on 2013-05-23
2
567 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

22 Experts available now in Live!

Get 1:1 Help Now