Solved

wordpress menu order

Posted on 2013-06-11
2
322 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exporting image to excel from php document 10 27
Dynamic varibles 5 32
AdminLTE with wordpress 15 52
What does $selected = $month == $beginning_month ? 'selected' : ''; mean? 5 26
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to Import and export files in WordPress. 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 : Click on Too…
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…

774 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