【发布时间】:2016-10-26 19:26:59
【问题描述】:
我无法在 Wordpress 中使用中继器显示图像。 出于某种原因,它只显示替代文本而不是图像本身? example
上面的图片是我的缩略图帖子,并且显示正确。 有谁知道这是什么原因造成的?
我的代码
<div class="row">
<div class="col-sm-6 left"><h1>COMMERCIAL</h1><br>
<div class="page-header">
<?php $mymovies = new WP_Query(array(
'post_type' => 'my_movies'
)); ?>
<?php while($mymovies->have_posts()) : $mymovies->the_post(); ?>
<div class="movie-colums">
<div class="thumbtitle group">
<div class="preview">
<?php the_post_thumbnail('thumbnail'); ?>
<h1><?php the_title(); ?><br>
<?php the_field('year'); ?>
<?php
// check if the repeater field has rows of data
if( have_rows('images_rep') ):
// loop through the rows of data
while ( have_rows('images_rep') ) : the_row();
// display a sub field value
the_sub_field('image');
endwhile;
else :
// no rows found
endif;
?>
</h1>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
提前致谢
【问题讨论】:
标签: php wordpress custom-post-type advanced-custom-fields