I don’t know what’s wrong with this code. I made a test site with a copy of my old site and used the same code but it’s not showing anything. it won’t even go into the if statement (I had echo’d every step to troubleshoot). Not sure if it’s settings in WP or this code. Please help?
<?php
// Check rows exists.
if( have_rows('slider') ): ?>
<div class="carousel-inner">
<?php // Loop through rows.
while( have_rows('slider') ) : the_row();
// Load sub field value.
$slider_photo = get_sub_field('slider_photo');
$slider_photo_cropped = get_sub_field('slider_photo_cropped');
// Do something...
echo wp_get_attachment_image( $slider_photo, 'url' );
echo wp_get_attachment_image( $slider_photo_cropped, 'url' );
// End loop.
endwhile;
// No value.
else :
// Do something... ?>
</div>
<?php endif; ?>
This is not solved. The image won’t show up. Can’t delete it. argh!
Have you solved this?
If not, how did copy the site? How did you copy the data in the ACF fields?