最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

get posts - Sort "get_pages" by menu order not ordering

programmeradmin1浏览0评论

I'm using this bit of code to generate a page full of items but they won't sort into the menu order, any ideas as to why?

   <?php $pages = get_pages(array('child_of', 'menu_order')); ?> 

I'm using this bit of code to generate a page full of items but they won't sort into the menu order, any ideas as to why?

   <?php $pages = get_pages(array('child_of', 'menu_order')); ?> 
Share Improve this question edited Jun 8, 2011 at 14:46 Rob asked Jun 8, 2011 at 14:00 RobRob 1,41613 gold badges41 silver badges68 bronze badges 2
  • 1 Why did you create $arg for arguments and didn't use it? – Anh Tran Commented Jun 8, 2011 at 14:23
  • That makes no sense, check the codex for the right syntax! codex.wordpress/Function_Reference/get_pages – Horttcore Commented Jun 8, 2011 at 14:59
Add a comment  | 

1 Answer 1

Reset to default 11

It should look like this:

<?php $pages = get_pages( array('sort_column' => 'menu_order') ); ?>

发布评论

评论列表(0)

  1. 暂无评论