Php ACF未显示以下产品
我似乎不明白为什么我的ACF字段不会显示在特色页面上我的woo commerce产品的下方,而它们的上方显示得很好 产品Php ACF未显示以下产品,php,wordpress,advanced-custom-fields,custom-wordpress-pages,Php,Wordpress,Advanced Custom Fields,Custom Wordpress Pages,我似乎不明白为什么我的ACF字段不会显示在特色页面上我的woo commerce产品的下方,而它们的上方显示得很好 产品 <div id="post-load" class="row products"> <?php $args = array( 'post_type' => 'product', 'posts_per_page' => -1, 'nopaging' =&
<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示例(如果放置在产品上方,则效果良好)
在哪里以及如何粘贴给定代码?内部模板part/content-product.php?或者?在何处以及如何粘贴给定代码?内部模板part/content-product.php?或
<?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; ?>