空でWooCommerceの特定のカテゴリの製品を並べ替える必要があります。さまざまな組み合わせを試しましたが、仕事はしません。同様に私は喘鳴を試みた特定カテゴリのskuによるWoo Commerce製品の並べ替え
$args = array(
'post_type' => 'product',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'orderby' => 'sku',
'order' => 'asc',
'posts_per_page' => $atts['per_page'],
'meta_query' => $meta_query,
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'product_cat',
'terms' => array_map('sanitize_title', explode(',', $atts['category'])),
'field' => 'slug',
'operator' => $atts['operator']
),
array(
'taxonomy' => 'product_tag',
'terms' => array_map('sanitize_title', explode(',', $atts['tags'])),
'field' => 'slug',
'operator' => $atts['operator']
)
)
);
$products = new WP_Query($args);
ここで、$ attrs []データはshortcodeパラメータから来ています。しかしそれはskuによって製品を分類しないのですか?
お手数をおかけします。
。それは空の代わりにSKUになります –