Skip Navigation

[Resolved] I need to set the featured post image from the user image automatically

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1169030

I've split that question into a separate ticket: https://toolset.com/forums/topic/add-link-to-profile-post-in-menu/

#1169334

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?

#1169823

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]
#1169866
02-without-for-each.png
01-for-each.png

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?

#1170014

Where can I see this on your site?

#1170015

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

#1170661

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.

#1171349

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

#1171350

My issue is resolved now. Thank you!