Hi Christian,
I have "migrated" the gallery custom fields from Profile CPT to User.
To display the images gallery before I used this code:
[wpv-for-each field="wpcf-galleria"]<br><a href="[types field='galleria' size='full' url='true' separator=',' rel='lightbox'][/types]">[types field='galleria' alt='%%ALT%%' title='%%TITLE%%' width='165' height='120' align='left' resize='crop' separator=', '][/types]</a><br>[/wpv-for-each]
and this display all I want and what I want.
Now, that I use the user custom fields, if I use the wpv-for-each, no image are displayed.
If I use this shortcode
<a href="[types usermeta='gallery' size='full' separator=', ' user_is_author='true' rel='lightbox'][/types]">[types usermeta='gallery' title='%%TITLE%%' alt='%%ALT%%' width='165' height='120' align='left' resize='crop' separator=', ' user_is_author='true'][/types]</a>
this code display the images two times in sequencing, before in big dimension, and after in resized dimension. I need to open them with the lightbox, but no src are generated...
What should I do to display the resized images with the link to lightbox the big sized images?
It looks like you should add url='true' in the link href shortcode. There's no reason to have rel="lightbox" in the custom field shortcode, because you're only producing a URL. If you want to trigger a lightbox, you probably need to add rel="lightbox" in the link tag instead.
[wpv-for-each field="wpcf-gallery"]<br><a href="[types usermeta='gallery' size='full' separator=', ' user_is_author='true' url='true'][/types]" rel="lightbox">[types usermeta='gallery' title='%%TITLE%%' alt='%%ALT%%' width='165' height='120' align='left' resize='crop' separator=', ' user_is_author='true'][/types]</a><br>[/wpv-for-each]
Hi Christian,
thanks for the reply.
I have used your code, but if I use wpv-for-each shortcode no images are displayed (see the attached image n°1)
When I use the code without the wpv-for-each shortcode I see the thumbnail images and them have a correct link, but when I click on the thumbnail image the lightbox is opening but no image is displayed. And near the images are displayed four ",". (see the attached image n°2)
Why and What could be a solution?
Where can I see this on your site?
Hi Christian,
you have the site admin access from here https://toolset.com/forums/topic/display-grand-parent-relationship/#post-1164859
If you enter go here hidden link
Okay thank you, I see what's happening now. The repeating field is on the User's WordPress Profile, and you want to display the images on the Profilo single post. The post author is the target User. I'm having trouble getting the wpv-for-each loop to work correctly in this case, as well. I am escalating this to my 2nd tier support team for additional investigation. I'll let you know what I find out.
Hi Christian,
I have found the solution to sync the Profile CPT post featured image with the user image.
Than this discussion can ended because now I have a solution to display all media content!
Thanks to all
My issue is resolved now. Thank you!