Skip Navigation

[Resolved] Image repeater fields in a template

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

This topic contains 2 replies, has 2 voices.

Last updated by mikemike 6 years, 9 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#156208

Hi,

I can't seem to find an solution to this anywhere.

Basically I have an image repeater field called "photo" and I need to display thumbnails of each photo on a page. I don't want to use shortcodes in the WYSWYG editor so I need to code it into my template.

My template just needs to output each image in a list in this format:

<li><a href="path-to-full-size-image" rel="prettyPhoto"><img src="path-to-thumbnail" /></a></li>

The path-to-full-size-image would obliviously be the original image that was uploaded, and the path-to-thumbnail would be the small image that also gets created by wordpress when an image is uploaded.

__________________________________________________________________________________________

Additional Information

FYI I've used...

add_image_size( 'Small', 150, 150, $crop = true );

...in my functions file for the thumbnail. So the path-to-thumbnail will need to use the 'Small' image, which can be easily echoed out with:

echo types_render_field("photo", array("raw"=>"false", "size"=>"Small"));

Thanks in advance.

#156271

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

#157087

Thanks Luoy. Perfect.

The forum ‘Types Community Support’ is closed to new topics and replies.