问题描述
我似乎无法弄清楚为什么当我的ACF字段在上方显示正常时,为什么我的ACF字段不显示在我的woo-commerce产品下方?
产品
<div id="post-load" class="row products">
<?PHP
$args = array(
'post_type' => 'product','posts_per_page' => -1,'nopaging' => true,'tax_query' => array(
array(
'taxonomy' => 'product_visibility','field' => 'name','terms' => 'featured','operator' => 'IN'
),),);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
global $product; ?>
<?PHP wc_get_template_part( 'content','product' ); ?>
<?PHP endwhile; ?>
</div>
ACF示例(如果放在产品上方,效果很好)
<?PHP
$features = get_field('features');
if( $features ): ?>
<div class="col-md-12"><h3 class="txtc"><?PHP echo esc_html( $features['title'] ); ?></h3></div>
<?PHP endif; ?>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)