|
魔扣币兑换比例:【 50以下 : ¥1 = 10 魔扣币 】丨【 50 - 100 :¥1 = 20 魔扣币】丨【 100以上:¥1 = 30 魔扣币 】
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
有时候我们需要在列表里显示某个自定义字段不为空的文章,比如用woocommerce插件时,只显示on sale的产品,那么代码如下:
- $args = array(
- 'post_type' => 'product',
- 'meta_query' => array(
- array(
- 'key' => '_sale_price', //自定义字段
- 'value'=> '',
- 'compare' => '!='
- )
- )
- );
- //另一种形式
- array(
- 'prdctfltr' => 'active',
- 'post_type' => 'product',
- 'post_status' => 'publish',
- 'posts_per_page' => $prdctfltr_global['posts_per_page'],
- 'meta_query' => array(
- array(
- 'key' => '_visibility',
- 'value' => array('catalog', 'visible'),
- 'compare' => 'IN'
- )
- )
- );
复制代码
|
|