Support

Account

Home Forums Add-ons Repeater Field ACF get title from image Reply To: ACF get title from image

  • You will need to set the return value of the image field to ‘object’, currently it looks set to ‘URL’.

    Then you can do something like this:

    <?php while ( have_posts() ) : the_post(); ?>
      <?php if( get_field('projectafbeelding') ): ?>
       <?php while( has_sub_field('projectafbeelding') ): 
        $image = get_sub_field('afbeelding');
       ?>
       <li style="background-image: url('<?php echo $image['url'];?>');">
        <?php echo $image['title'];?>
       </li>
      <?php endwhile; ?>
    <?php endif; ?>
    <?php endwhile; ?>