?
Solved

wordpress menu order

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

762 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