Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

wordpress menu order

Posted on 2013-06-11
2
Medium Priority
?
335 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
[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

Accepted Solution

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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 create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
Suggested Courses

636 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