Solved

wordpress menu order

Posted on 2013-06-11
2
326 Views
Last Modified: 2013-06-11
Hello,

I have the following code and I was wondering if it was possible to order by menu_order instead of alphabetically.

			$pages_data=get_pages(array('child_of'=>$item->object_id));
			if ($pages_data) {
			$item_output .= '<div class="drop"><div class="holder"><ul>';
			foreach($pages_data as $page){ 
				$item_output .= '<li class="" id="menu-item-'.$page->ID.'"><a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a></li>';
			}
			$item_output .= '</ul></div></div>';
			}

Open in new window

0
Comment
Question by:movieprodw
2 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 39238685
$pages_data=get_pages(array('child_of'=>$item->object_id, 'sort_column' => 'menu_order'));

Read the Codex for more information:

http://codex.wordpress.org/Function_Reference/get_pages
0
 
LVL 1

Author Closing Comment

by:movieprodw
ID: 39239691
Thanks
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This video teaches users how to migrate an existing Wordpress website to a new domain.
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…

828 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