Hi @artgoddess and thanks for using this plugin 🙂
If the post type supports native WordPress thumbnails, on the template creation page as soon as you choose the post type among the first available shorcodes you will find the “thumbnail” one.
Dont forget to leave your review ❤️
Great! It works. But then the image is inserted without any style.
And now my question is whether it is possible to use the link with the image block from the Gutenberg editor.
Many thanks! 🙏🏻
This reply was modified 2 years, 7 months ago by ArtGoddess .
add_filter(‘post_thumbnail_html’, function($html, $post_id, $post_thumbnail_id){
if(is_singular(‘YOUR_POST_TYPE_KEY’)){
return wp_get_attachment_url($post_thumbnail_id);
}
return $html;
}, 10, 3);
Add this code on the functions.php file of your theme/child theme, change YOUR_POST_TYPE_KEY of your template (ex: post, product, ecc).
Now the shortcode return the image url.
Let us if it works 🙂
Yes, it returns only the path. But I am not capable to use this path with the Gutenberg image block.
Any suggestion? Many thanks!
I have solved the issue using the “Post Featured Image”, as my Custom Post Types have a Featured Image.
Thank you again for your support.