?
Solved

Wordpress Change Order Of Nav Menu

Posted on 2013-05-23
2
Medium Priority
?
578 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

750 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