1
我在Woocommerce中有產品的自定義頁面模板,但是我想按屬性的術語名稱asc訂購產品。我有三個術語。我不知道這樣做的正確的方式,我已經試過這樣:按屬性名稱升序的Woocommerce訂單產品
<?php
args = array(
'post_type' => 'product',
'posts_per_page' => 20,
'meta_key' => 'pa_tire-type',
'orderby' => 'meta_value_num',
'order' => 'asc'
);
$loop = new WP_Query($args);
while ($loop->have_posts()) : $loop->the_post();
global $product; ?>
嗨,你能看到整個頁面的代碼? – alexanderstanchev