Home › Forums › Back End › FOR loop with counter in variables › Re: FOR loop with counter in variables
May 20, 2013 at 4:49 pm
#135759
Participant
@dclardy: yep, advanced custom fields.
@traq: yup, that works! Finally, thanks.
I think the whole confusion is rooted in the way quotes have to be used. It sure confused me, because of the double quotes (see @melindrea’s comment), but it does seem the way to go. This is what I’ll end up with, although I can’t fully wrap my head around why it’s working….
for( $i=1; $i<4; $i++ ){
if( get_field( “product_image_$i” ) ){ echo get_field( “product_image_$i” ); }
}