Sauter la navigation

[Résolu] auto show first image?

This support ticket is created Il y a 5 années et 4 mois. 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par a.R Il y a 5 années et 4 mois.

Assisté par: Waqar.

Auteur
Publications
#1338457

a.R

hi there,
is it possible to automatically display the first image from a post text in search results previews of a custom search?
so one had a preview image without having to define a post image...
THANK YOU, regards, Achim

#1338633

Hi Achim,

Thank you for contacting us and I'd be happy to assist.

I'm afraid, there is no builtin feature available in Toolset, which can get the first image from the post's content, automatically.

You can create a custom shortcode ( ref: https://toolset.com/documentation/adding-custom-code/how-to-create-a-custom-shortcode/ ) which gets the post's content and then extract the first available image.

Here are some relevant guides with example code snippets:

lien caché
lien caché
lien caché
https://stackoverflow.com/questions/18544915/get-first-image-from-wordpress-post

I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#1344445

a.R

ok, that sounds complicated.
THANK YOU.