Home Forums General Issues Image link to attachment page Reply To: Image link to attachment page

  • You’re going to need to alter the field so that it returns the attachment ID instead of the URL. For more information see WP doc for the functions I use here.

    $images = get_field('galerie_bd');
    if( $images ): ?>
    <ul class="rslides">
            <?php foreach( $images as $image ): ?>
                    <a href="<?php echo get_attachment_link($image); ?>">
                             $size = 'thumbnail';
                             $attach = wp_get_attachment_image_src($image, $size);
                         <img src="<?php echo $attach[0]; ? />" />
            <?php endforeach; ?>
    <?php endif; ?>