按管理员的页面属性顺序字段对页面进行排序?


8

是否可以使用管理员的order字段(在页面属性下)对循环中的页面进行排序?

Answers:


20

是的,在查询中使用orderbyand order子句。

query_posts( array('orderby'=>'menu_order', 'order' => 'ASC' ) );

请参阅:WP_Query#Order以供参考


3
请注意,您还需要使用order参数,例如:'order' => 'ASC'
iCantSeeSharp
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.