The shortcode [wpv-for-each] is displaying as plain text. The images are being displayed, but the html codes that are supposed to loop aren't working.
echo do_shortcode('[wpv-for-each field="wpcf-wedding_ceremony_photos"]
<figure class="figure">
<a href="#" class="lightbox-image" data-gal="prettyPhoto[1]">
[types field="wedding_ceremony_photos" width="128" height="128"][/types]
</a>
</figure>[/wpv-for-each]');
I can actually use get_post_meta, as an alternative. However, I really need to use Types' auto thumbnail resize feature.
Help will be appreciated 🙂
Hi keaneL-2,
Are you using latest version of Views?
You can download it here:
https://toolset.com/my-account/downloads/
And the shortcode [wpv-for-each] is a feature of Views.
Please let me know if you need more assistance.
Regards
Luo
Hi Luoy,
I'm using the latest version of Types. The images are displaying correct, there are multiple values for that particular custom field.
Since I'm not using Views, how can I display all images and wrap each image in HTML code?
Thanks.
Please add "index" parameter in the Types shortcode, like this:
$photos = get_post_meta(get_the_ID(), 'wpcf-wedding_ceremony_photos', false);
foreach($photos as $index => $photo)
{
echo do_shortcode('<figure class="figure">
<a href="#" class="lightbox-image" data-gal="prettyPhoto[1]">
[types field="wedding_ceremony_photos" width="128" height="128" index=' . $index .'][/types]
</a>
</figure>');
}
Please let me know if you need assistance to do it