?
Solved

Wordpress Change Order Of Nav Menu

Posted on 2013-05-23
2
Medium Priority
?
575 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_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 1000 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 1000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

764 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