I'm using Advanced Custom Fields plugin on my wordpress website. I'm displaying on a page the first image ('photo') of a repeater field ('photos_presse') from children page. here is the php code I'm using.
<?php
$args = array(
'post_type' => 'page',
'post_parent' => $post->ID,
'order' => 'ASC',
'orderby' => 'menu_order',
'post_status' => 'publish',
'number' => 'no limit',
);
$parent = new WP_Query( $args );
if ( $parent->have_posts() ) : ?>
<?php while ( $parent->have_posts() ) : $parent->the_post(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<div id="parent-<?php the_ID(); ?>" class="parent-page">
<div class="cartouche_crop">
<?php
$first_img = true;
while($first_img && has_sub_field('photos_presse')): ?>
<img src="<?php the_sub_field('photo'); ?>" class="artists_menu">
<?php $first_img = false; ?>
<?php endwhile; ?>
</div>
<h1><?php the_title(); ?></h1>
</div>
</a>
<?php endwhile; ?>
<?php endif; wp_reset_query(); ?>
this is the portion of code to get the first image :
<?php
$first_img = true;
while($first_img && has_sub_field('photos_presse')): ?>
<img src="<?php the_sub_field('photo'); ?>" class="artists_menu">
<?php $first_img = false; ?>
<?php endwhile; ?>
when loading an image in the repeater field, it creates thumbnails images, this can be set in my "media settings" menu in my wordpress admin. (small, medium & large).
It creates 4 files for each images, one small, one medium, one large and and the original siez.
what I would like to do is instead of getting the first original image of each repeater field, I would like to get the first medium size thumbnail of repeater field.
I can't find how to do this...
anybody can help me with this ?
thanks for your help