最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - Query when is one or several values

programmeradmin1浏览0评论

I'm trying to make filter by querying different elements from a custom post type (stores)

The problem is when I want to query the "styles", given that all stores have 2 or more instead of just one and the query is not working

$style = $_GET['style'];
if(empty($style)) {
    $style = array('Casual/Décontracté','Classique','Luxe','Vintage','Street/Sports','Gothic/Underground' );
}

<div class="row"><?php
if(have_posts() ):
    $args = array( 
        'post_type' => 'store', 
        'meta_key' => 'store_client_type' ,
        'meta_query' => array(
            'style_clause' => array(
                'key' => 'store_style', 
                'value' => $style,
            ),
        )
    ),  
);
发布评论

评论列表(0)

  1. 暂无评论