Skip Navigation

[Resolved] Use first uploaded image on gallery field as featured image

This support ticket is created 2 years, 9 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 12 replies, has 2 voices.

Last updated by Shane 2 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#2348735
slug.png
Screenshot 2022-04-25 181019.png
Screenshot 2022-04-25 180959.png

Tell us what you are trying to do?
I want to make first photo that I upload from gallery field as featured image

Is there any documentation that you are following?
https://toolset.com/forums/topic/use-first-uploaded-image-as-featured-image/

Is there a similar example that we can see?

What is the link to your site?
hidden link

#2348835

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Steve,

Thank you for getting in touch.

Would you mind allowing me to have admin access to the website so that I can have a more detailed look at this for you ?

Please where applicable please provide me with a link to an example page where I can see the issue.

I've enabled the private fields for your next response.

Thanks,
Shane

#2349639

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Steve,

Thank you for the login details, however i'm not seeing where you've provided me with a link to the form on the frontend.

I will need to see this in order to test the form and the code.

Thanks,
Shane

#2349703
Screenshot 2022-04-26 232049.png

Here's the link for the form : hidden link
You can type on the field to display all the form field.

#2349741

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Steve,

This should now be working. In order for the code to get the image's URL the "Use the WordPress Media Library manager for image, video, audio, or file fields" setting must be enabled on your form.

The reason is that a URL for the image will need to be generated when it is uploaded and this needs to be done before the form has been submitted.

Thanks,
Shane

#2350237
Screenshot 2022-04-27 114504.png
Screenshot 2022-04-27 114450.png

Hi Shane,

Thank you for your help.
It's still not working from my side. You can find card with featured image display on this page hidden link

Any help?

Thank you

#2350737

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Steve,

Not sure why its not working on your end but as soon as I entered my image in the field it works. See my post here.
hidden link

Can you record a short demo of you going through the process so that I can see exactly what is being done.

Thanks,
Shane

#2351277

Hi Shane,

Thank you for your help.
It works now. Not sure what went wrong before.

Cheers

#2351781

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Steve,

Happy to see that everything is ok now.

If there are no further questions you can go ahead and mark this ticket as resolved.

Thanks,
Shane

#2352281

Hi Shane,

Thank you for your help.
Is there any way to make the snippet code works with default media library manager from toolset form instead of using WordPress Media Library manager?
We don't want to have all user to see all the media from another user.

Thank you,

#2352545

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Steve,

Unfortunately no it isn't as the images need to be first uploaded before they can be picked up to be added as featured images.

If you have our Access plugin installed you can essentially moderate the media library so users will only have access to the images they upload and not see every other images in the library.

Thanks,
Shane

#2352597

Hi Shane,

Thank you for your help. Access plugin is good solution.

#2352687

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Steve,

Great if there are any issues please let me know.
Thanks,
Shane