分类法自定义现场图像未显示
我想在主页上循环显示分类自定义字段图像 “开发商”是分类名称 “developer_logo”是图像字段 slug 我使用的代码仅显示名称,但图像未显示
<?php
$terms = get_terms( array( 'taxonomy' => 'developers', 'hide_empty' => false ) );
$image = get_field('developer_logo');
foreach ( $terms as $term ) : ?>
<div class="col-lg-4 col-md-6">
<div class="product product-zoom product--card">
<div class="product__thumbnail">
<img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo $term->name; ?>">
</div>
<div class="product-desc">
<h4 class="text-center mb-2"><?php echo $term->name; ?></h4>
</div>
</div>
</div>
<?php
endforeach
?>
我只想显示分类自定义字段的图像
I want to show taxonomy custom field images on loop on the home page
"developers" is taxonomy name
and "developer_logo" is image field slug
I used that code only name is showing but image is not showing
<?php
$terms = get_terms( array( 'taxonomy' => 'developers', 'hide_empty' => false ) );
$image = get_field('developer_logo');
foreach ( $terms as $term ) : ?>
<div class="col-lg-4 col-md-6">
<div class="product product-zoom product--card">
<div class="product__thumbnail">
<img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo $term->name; ?>">
</div>
<div class="product-desc">
<h4 class="text-center mb-2"><?php echo $term->name; ?></h4>
</div>
</div>
</div>
<?php
endforeach
?>
I just want to show the images of taxonomy custom field
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)