Passer la navigation

[Résolu] Featured Image ID

This support ticket is created Il y a 4 years, 2 months. 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 -

Fuseau horaire du supporter : America/Jamaica (GMT-05:00)

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

Dernière mise à jour par Ian Il y a 4 years, 2 months.

Assisté par: Shane.

Auteur
Publications
#2313571

Ian

I want to be able to output the featured image ID in order to add it to a gallery.

#2313595

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Ian,

Thank you for getting in touch.

This is something that will require some amount of custom code to achieve.

You should be able to create a shortcode that employs the use of this function below.
https://developer.wordpress.org/reference/functions/get_post_thumbnail_id/

You will pass the ID of the current post in order to retrieve the thumbnail ID.

Please let me know if you're aware of how to do this.

Thanks,
Shane

#2313697

Ian

A simple way to return image IDs seems like it should be a core option.