我正在尝试为两种帖子类型(帖子和产品)构建一个wp\\u查询。第二种是woocommerce自定义帖子类型。目标是获得按日期排序的帖子列表。类似这样:
- Post 3. (april, 3)
- Post 2. (march, 15)
- Product 2. (february, 10)
- Post 1. (january, 4)
- Product 1. (january, 1)
我有这样的论点:
$args = array (
\'post_type\' => array( \'product\', \'post\' ),
\'nopaging\' => true,
\'meta_key\' => \'_featured\',
\'meta_value\' => \'yes\',
\'orderby\' => \'date\',
\'order\' => \'desc\',
);
但它会返回一个单独的帖子类型列表:
- Post 3. (april, 3)
- Post 2. (march, 15)
- Post 1. (january, 4)
- Product 2. (february, 10)
- Product 1. (january, 1)
如何获得混合这两种帖子类型的唯一列表?(如第一个例子)提前谢谢你。