Skip Navigation

[Resolved] showing featured image of certain post

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display the featured image of a specific post

Solution:
You can use the view's shortcode [wpv-post-featured-image] to output the featured image. To target the specific post, you can use the "item" attribute.

You can find the proposed solution, in this case with the following reply:
=> https://toolset.com/forums/topic/showing-featured-image-of-certain-post/#post-1607975

Relevant Documentation:
=> https://toolset.com/documentation/views-shortcodes/#wpv-post-featured-image

This support ticket is created 4 years, 8 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by mikeH-3 4 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#1607577

How do I show the featured image from a certain post (48883) in a php template? I tried this function below to make a shortcode for it but it doesn't seem to work:

// Function Logo
function sermon_graphic() {
$graphic = do_shortcode('[types field="the_post_thumbnail" output="raw" id="48883"][/types]');
echo "$graphic" ;
}
add_shortcode('sermongraphic', 'sermon_graphic');

#1607975

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You can use the view's shortcode [wpv-post-featured-image] to output the featured image.

In your case - For example:

$graphic = do_shortcode('[wpv-post-featured-image item="48883"]');

More info:
https://toolset.com/documentation/views-shortcodes/#wpv-post-featured-image

#1608455

My issue is resolved now. Thank you!