我创建了一个函数,用于检索帖子的所有父帖子,并按post_date排序。
select * from {$wpdb->posts} where post_type = 'page' and post_status = 'publish' and post_parent = " . ($parent == 0 ? $page_id : $parent) . ' order by post_date asc
我的WP后端的帖子是不同的顺序,它不是按发布日期也不是按ID。
你知道我如何对我的查询进行排序,以便获得与后端相同的顺序吗?
谢谢,Radu
阅读本文,这里有六种方法可以自定义WordPress中帖子的排序顺序。
自定义WordPress后订单的6种方法
还必须看到这个链接:
http://wpquestions.com/question/show/id/1009