Solved

Wordpress Change Order Of Nav Menu

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

730 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