我有一个自定义帖子类型(CPT),名为property. 我注册了一处特色房产metabox如本问题所述”How do I create a featured post within a custom post type?“。因此,特色物业meta_key=\'property_featured\' 和meta_value=on.
我想做的是展示all property 发布,但按meta_key=\'property_featured\'. 因此,特色属性将首先出现在第一页的列表中。行为类似于Sticky Posts 功能。还有其他的property 帖子将按创建日期排序。此外,我需要确保分页工作正常-处理所有property 一起发布。我使用自定义分页代码解释here. (希望这有意义)。
我尝试为WP\\U查询指定参数。但是,如果我指定:
\'meta_key\' => \'property_featured\',
\'orderby\' => \'meta_value\'
那么
only property 带有该键的帖子显示为与
all property 职位。
如果我删除meta_key 从参数中,查询不知道按什么排序
如何显示所有property 发布,确保featured 一个先出现,其他的都出现property 按发布日期发布订单?
非常感谢,Dasha