To be honest, I do’t see anything on that page mentioning “menu_order”.
Only Pages have menu order, btw.
Nothing on that page specifically says that, but there is a line that says “Note: The $orderby value can be the name of any field in the wp_posts table.”
And menu_order is a column in the wp_posts table.
Hmmm…
see the history:
http://codex.wordpress.org/index.php?title=Template_Tags/get_posts&action=history
and Schulte’s notes on July 12, 2005. Keyword: “assume”.
Since there is no possibility to define anything as “menu_order” for the posts (as you have in the Write Page subpanel), I think, no, I assume it does’nt really work for posts 🙂
Actually, I am using get_posts to get pages (post_type=page). So you would assume it would work. But we all know what assuming can do. 🙂
I guess this should be filed as a bug then, or the codex updated? Or is there another way that I should be getting pages in this manner?
get_posts('post_type=page&post_parent=80&orderby=menu_order&numberposts=');
Thanks!
Ah, I was able to resolve this by using get_pages and sort_column as one of the params.
See: http://wordpress.taragana.net/nav.html?wp-includes/post.php.source.html#l1014
For more info.
WP 2.7, wp-includes/query.php at line 2041 seems like not having code for case “menu_order”
Change
case 'menu_order':
break;
to
case 'menu_order':
$orderby = "$wpdb->posts.menu_order";
break;
and it will work. Write this change down somwhere 🙂
Strange it’s not implemented.