0

I want to list the wordpress pages order by the page order. Default order is by title.

 $pages = get_pages('child_of= 22&&title_li=&sort_column=> menu_order');

I tried the above one. Bit it doesn't works. Is there any option to do the sorting with the order fields

4

1 回答 1

5

你的语法错误。=>当您将数组传递给get_pages;时,您需要 如果你传递一个字符串,你需要=. 因此,以下任何一项都应该执行您粘贴的代码所暗示的内容:

$pages = get_pages('child_of=22&title_li=&sort_column=menu_order');

或者

$pages = get_pages(array(
    'child_of' => 22,
    'title_li' => '',
    'sort_column' => 'menu_order'
));
于 2013-05-06T10:08:24.150 回答