我如何能够按照以下顺序对从循环中收到的Wordpress文章进行排序:
1、6、2、7、3、8、4、9、5、10
使用类似如下的查询:
$article_feed_query = new WP_Query( array(
'post_type' => 'post',
'posts_per_page' => 10,
'orderby' => 'date',
'order' => 'desc',
'offset' => 1,
));发布于 2017-09-29 22:05:42
Here is the solution for set the custom order.
step1: Please add this plugin https://wordpress.org/plugins/simple-custom-post-order/.
step2: go to setting and check your post type that you want to change the order.
step3: go to your post and drag and drop the post from admin.
step4: add this below code in your template
$article_feed_query = new WP_Query( array(
'post_type' => 'post',
'posts_per_page' => 10
));https://stackoverflow.com/questions/46489850
复制相似问题