如何在WordPress和Display产品中通过ACF字段获取WooCommerce产品ID

时间:2019-07-05 作者:varsha choudhary
$product_cat_object = get_queried_object();
        $axy = get_field(\'select_artists\', \'product_cat_\' . $product_cat_object->term_id);  

       $args = array(
    \'post_type\' => \'product\',
    \'tax_query\' => array(
        array(
            \'taxonomy\' => \'product_cat\',
        \'posts_per_page\' => 100,
            \'terms\'    => array(var_dump($axy) ),
        ),
    ),
);
1 个回复
SO网友:Ishaan Malik

仅使用$axy 而不是\'terms\' => array(var_dump($axy) ), ...这会管用的,乖戾。试试看。

        \'terms\' => $axy,

相关推荐