首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Post__in 'orderby‘orderby’orderby

相关·内容

WordPress 文章查询教程6:如何使用排序相关的参数

第六讲关于排序相关的参数,排序相关的参数就是 order 和 orderby 两个参数,但是值比较多比较多: 首先是 order 参数,数据类型为:(string | array),用于指定 “orderby...” 参数的升序或降序,默认为”DESC”,即为降序,如果是数组的话,可用于多个 order/orderby 集: ASC – 升序,从最低值到最高值 (1, 2, 3; a, b, c) DESC –...降序,从最高值到最低值 (3, 2, 1; c, b, a) 然后是 orderby 参数,数据类型为:(string | array),按参数对检索到的文章进行排序。...也可以使用 meta_value_* 来指定,例如转换为 DATETIME 类型时,也可以使用 meta_value_datetime 来作为 orderby 参数。...post__in – 按照 post__in 参数中给出的文章 ID 顺序进行排序,注意使用 post__in,order 参数的值无效。

1.5K30

query_posts函数使用方法小结|wordpress技巧

php //仅显示置顶文章 array(‘post__in’=>get_option(‘sticky_posts’)) //将文章的置顶属性清除掉,以正常文章顺序排序(例如发表日期)显示出来 caller_get_posts...‘showposts’ => 6 //仅显示文章编号为5,12,2,14,7的这5篇文章 ‘post__in’ => array(5,12,2,14,7) //仅显示文章编号不为5,12,2,14,7...php //依照发表作者排列 orderby=author //依照日期排列 orderby=date //依照标题排列 orderby=title //依照最后编辑时间排列 orderby...=modified //依照分页顺序排列(仅适用于分页) orderby=menu_order // (不知道XD…) orderby=parent //依照文章编号排列 orderby=ID...//随机排列 orderby=rand //依照自订栏位数值排列 orderby=meta_value //依照预设排列 orderby=none //依照回响数排列 orderby=

83410
领券