我正在使用高级自定义字段插件作为转发器,我可以让它工作,除了没有加载的图像。
有人能看到错误在哪里吗?
<?php
// check if the repeater field has rows of data
if( have_rows(\'top_ten\') ):
// loop through the rows of data
while ( have_rows(\'top_ten\') ) : the_row();
// vars
$im = get_sub_field(\'tool_image\');
// $tool_image = get_field(\'tool_image\');
if( !empty( $im ) ):
?>
<div class="col-md-12">
<div class="row my-5">
<div class="col-md-6">
<img src="<img src="<img src="<?php echo esc_url($im[\'url\']); ?>" alt="<?php echo esc_attr($im[\'alt\']); ?>" class="top-ten">
<div class="col-md-12">
<div class="row mt-3">
<div class="col-md-6">
<a href=""
class="btn btn-primary rounded-0 my-3 p-3 w-100 text-uppercase" href="#" role="button">
<?php the_sub_field (\'button_learn\'); ?>
</a>
</div>
<div class="col-md-6">
<a href=""
class="btn btn-primary rounded-0 my-3 p-3 w-100 green-bg text-uppercase" href="#" role="button">
<?php the_sub_field (\'button_learn\'); ?>
</a>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p style="text-align: center;">
<?php the_sub_field (\'tool_category_description\'); ?>
</p>
</div>
</div>
</div>
</div><!-- .end // col-md-6 -->
<div class="col-md-6">
<h1 class="h1-responsive pt-3 mb-4 text-uppercase top-ten-header">hacker</h1>
<p class="lead nicered text-uppercase"><?php the_sub_field (\'tool_category_description\'); ?></p>
<p class="lead text-uppercase"><?php the_sub_field (\'tool_cost\'); ?></p>
<div class="content">
<p><?php the_sub_field (\'tool_description\'); ?></p>
</div>
</div><!-- .end // col-md-6 -->
</div><!-- .end // row my-5 -->
</div><!-- .end // col-md-12 -->
<?php
endif;
endwhile;
else :
// no rows found
endif;
?>
感谢您的帮助/指导-谢谢!