Make sure to use echo
with get_the_post_thumbnail()
:
echo get_the_post_thumbnail(64 , 'post-thumbnail', array( 'class' => 'img-format-big' ) );
In WordPress, a rule of thumb (no pun intended) is to use echo
with functions prefixed with get_
. Functions prefixed with the_
on the other hand, display their output immediately (e.g. the_post_thumbnail()
).
Related Posts:
- How to disable WordPress from creating thumbnails?
- set_post_thumbnail_size vs add_image_size
- the_post_thumbnail responsive srcset not populating with custom image size
- Set custom name for generated thumbnails
- New image size version only for the Featured Image file
- wp_get_attachment_image_src always returns full-sized image
- Add Title Attribute to WordPress Image the_post_thumbnail
- Can WordPress crop only the post thumbnails?
- Query the post which have a thumbnail
- Autogenerated Thumbnail compression depending on size
- How to use images uploaded with custom implementation of thickbox like the_post_thumbnail() functionality
- Media thumbnail for custom post inside post content
- Thumbnail and Featured Image With Fixed Sizes?
- List category posts – Thumbnails are not displaying
- Why am I getting errors in product.thumbnails.php? [closed]
- Is there a way to change a post’s thumbnail image(s)?
- how i can increase Featured thumbnails size?
- How check that there is post thumbnail feature image or not on wordpress?
- Force WordPress to strip/remove EXIF/IPTC metadata when resizing thumbnails
- If I Regenerate Thumbnails, would WordPress delete the existing Thumbnails and replace them with ‘new copies’?
- Is it possible to nest get_previous_post()?
- How to get cropped thumbnail source for custom post type
- Get ID of featured image using “get_post_thumbnail_id(the_ID())” – without printing to screen?
- How to offset thumbnails to the center?
- Sidebar Thumbs Squished?
- Aligning the thumbnail image
- Post thumbnail not working after regenerate
- How do get post thumbnail into plugin?
- “Medium” size image displayed instead of “thumbnail” in only one post, other posts are fine
- How to create resized versions of images added with wp_insert_attachment
- get_post_thumbnail_id() Doesn’t return value [closed]
- How To Add and Display Category Image
- get_the_post_thumbnail(‘thumbnail-name’) always returns empty string
- Can’t get post thumbnail to display in foreach loop
- Show posts image attachments
- Thumbnail is showing outside its div instead of inside it
- Category page with thumb is ok but can’t do the same with tags
- how can I call a posts featured image in any template?
- how to resize thumbnail image
- Different thumbnails for index and article page
- Thumbnails not being generated for PDF files
- Thumbnail size problem Desktop vs Mobile site
- How do you code a featured image into an XML as a jpg link, instead of using a data-id number?
- How to change the format of thumbnails into wordpress theme?
- display div tag only if post has thumbnail
- Thumbnails are hard cropped not matter what
- Thumbnails regenerate wp_generate_attachment_metadata
- Featured image size always cropped bottom
- set_post_thumbnail() shows Unattached on backend under Media
- Allow ‘Set featured images’ to select multiple images
- Why wordpress doesn’t generate thumbnails?
- Force Regenerate Thumbnails Not Working
- Trouble Retrieving Thumbnail URL on Front-Page
- I would like my posts to pull my custom cropped thumbnail instead of creating its own thumbnail from Featured Image
- WordPress save thumbnail but don’t show it [closed]
- Automatic adding thumbnail to post
- Different thumbnail size than actual picture in post
- Where is the template from the_post_thumbnail()?
- Images thumbnail not cropping square
- Skip posts without a thumbnail in loop
- Resizing Images to lower Disk Space Using Plugins
- Set (featured) thumbnail for post?
- How to make thumbnail images click into blog posts
- Customising the size of images served in Visual Composer elements [closed]
- How to scale up post thumbnails/featured image?
- Change size of featured image in Edit Post screen
- How to make thumbnail image fit into a div where image dimentions are completely different?
- the_post_thumbnail ignores size parameter
- Confused with the loop and repeating things
- Using concatenate with WordPress Thumbnail
- Notice: Trying to get property of non-object when trying to get thumbnail URL
- How can I see where in my themes and plugins certain image sizes are used?
- How do I remove featured images and captions from a wordpress RSS feed?
- Video playing from featured image?
- How can I check for a thumbnail in WordPress?
- array set title and alt in the_post_thumbnail
- Get thumbnail image according to the screen
- Displaying Post Featured Images on All Pages
- Use Featured Image of Post as Header Image
- How to display featured image description and title?
- Can I prevent get_the_post_thumbnail from falling back to the global post ID?
- Else/If Statement to Display Photo Descriptions
- Custom header image, and content, on Posts Page in twentyeleven with Static Front Page
- Resizing old post thumbnail images
- Create an instance of add_image_size
- Enable featured image but not have it show up?
- custom image size not being displayed in loop
- Show thumbnail depending on image width
- Smush Featured image constraining in image file that is being loaded on page
- After migrating media library is not showing thumbnails
- Why image Thumbnail url is not displaying with custom size?
- More tag and featured image
- Disable custom image size creation for plugins
- featured image different style on the list and on single post
- set_post_thumbnail_size has no effect – always 200×300 size is generated
- Adding a class to certain featured images
- To CSS Style on the image uploaded on a Post under Content Section
- wordpress featured image
- How to make the featured image just show up on the blog page?
- How to display featured image caption only if exists?