Support

Account

Home Forums Add-ons Repeater Field Make Image Field Display Thumbnail Size

Helping

Make Image Field Display Thumbnail Size

  • For the life of me, I cannot figure out how to make a repeater image-field display the thumbnail version of a photo. All it continues to echo is the full-size version.

    Attached are the ins and outs:

    Heres the page in question:
    http://www.globalvortexrecords.com/artists/artist-1/

    And heres the code:

    <ol>
                    <?php if( get_field('album-list')): ?>
                        <?php while( has_sub_field('album-list')): ?>
                                <li>
                                    <div class="thumbnail"><img />" /></div>
                                    <div class="album"><?php the_sub_field('album'); ?></div>
                                    <div class="release-date clear"><?php the_sub_field('release-date'); ?></div>                         
                                </li>
                        <?php endwhile; ?>
                    <?php endif; ?>
                </ol>

    Would like for it to return the cropped thumbnail version. Right now, it just echoes the full-size photo which is an 800×600.

    Any help is appreciated!

  • Hi @nickolaas

    To display an image size other than ‘full’, you need to firstly set the return type to either ID or Object.

    From this data, you can then load the correct image size.

    Please see the image field docs for examples:
    http://www.advancedcustomfields.com/resources/field-types/image/

    Please note you are using a sub field, so load the iD or Object via get_sub_field

    Thanks
    E

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Make Image Field Display Thumbnail Size’ is closed to new replies.