Use get_the_post_thumbnail( $id )
:
$thumb = get_the_post_thumbnail( $id, 'post-thumbnail' );
Related Posts:
- Change admin bar to default:off
- How to change post thumbnail title and alt attributes to post title?
- Get password when user registers and save it sha1 into database
- Should I use add_filter for functions in function.php of the theme?
- Pass variable to hook. Its possible?
- Redirect to another page using contact form 7? [closed]
- Replace single_template filter with what for default posts?
- How to disable thumbnail filter for a specific template part or image size?
- How to set default values for edit_post_link() in my theme?
- How to make excerpt image be full size instead of thumbnail?
- WP “optimizing” PNGs into thumbnails 5X larger than originals – FIX
- optimized PNGs 5X larger than originals
- WordPress taxonomy and archive custom class
- Filter categories used with Custom Structure Permalink
- How do I turn a post thumbnail into a background image?
- Reactor Theme: Prevent Post Thumb on Post
- Theme Customizer not loading JS for live preview
- Remove “You are using WordPress 3.2.1” from Right Now Dashboard Widget
- Replace function in a child theme
- Custom theme, contact form 7 & fast secure form doesn’t work
- Featured Image meta box not showing up
- How to wrap all titles generated by Gutenberg “Heading” block with tag
- How do I remove inline style in featured image markup?
- Change the “Default Avatar” admin option via functions.php
- Check if the image size is available and if not use ‘full’ image size
- Set a featured image as a replacement to the header image
- Unique design inside a specific category’s url
- How to rotate every letter in a title
- Dynamic Post Thumbnail →
- Issue on Getting Custom post type Thumbnail’s URL
- How To Pick Custom Size Of Uploaded Image In Theme Via the_post_thumbnail();?
- JQuery undefined and Stylesheet loads in bottom along with js files
- the_post_thumbnail() get the URL to the “medium” sized image
- CSS class on last post in loop ( custom query )
- How to call the_time current?
- How to change footer credit text in Twenty Twenty One theme with a hook?
- Use a filter on menu items that have children
- Modify available templates (in dropdown)
- tiny_mce_before_init: ‘exact’ => true has no effect
- How to add aria role and schema markup to custom walker container
- Full width featured thumbnail
- How to conditionally add a wp_filter
- Add content after get_header
- Filter didn’t work on content class (hybrid_post_attributes)
- Can’t change theme name
- How to add icon over specific thumb
- How can I get the featured image or the first image for a post/page and display it as a banner?
- Tiny MCE custom styles, and preview in the backend
- How can I scale down the width of images in bulk that are embedded in posts throughout the site?
- Add image URL automatically to custom field?
- content filter (add_filter) for category description?
- Related Post Category Filter
- Pagination don’t work with active filters
- theme directory fallback image outputs url and not the image
- How to register dynamic settings in WordPress Customizer?
- restrain filter on get_the_excerpt to queried item in stead of current post
- Unpublished Pages Failing To Appear On Custom Path
- Override category archive page title (not the head title)
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- remove_filter function to unhook twentysixteen parent theme function
- Embedding CodePen Calorie Script – jquery error
- WordPress wp_get_current_user returning blank values until refresh
- Created blank theme for REST API, featured image not appearing on admin side
- Alternative solution for script_loader_tag?
- Alt header logo and link for specific pages
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- Make a custom field in admin post.php read only
- Best way to add image to recent posts widget?
- Hook in parent theme Menu function
- How do I remove p tag *insertions*? Disabling `wpautop` removes manual tags
- How to add custom nav_menu_css_class to certain menu only?
- Full width thumbnail
- How to manipulate wordpress template tags’ output
- WordPress permalink setting
- Featured Image Module Randomly Disappears
- what is do_action(); in wordpress? [duplicate]
- Apply height and width for the_content() inside youtube video tag
- Single Featured Image Repeating
- Allow tags and attributes in post and pages content
- Suppress the_content filter in a nested loop
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- enqueue script if page is not equal to
- Mamp pro permalink issues. Pages keep reverting to index.php
- loading custom.js file after jquery is loaded
- Show post thumbnail only if it exists using timthumb
- Add rel to all images in a post
- IS there any reason not to include javascript in my own post’s embeds?
- Display Page featured Image as well as Posts featured Image
- Creating custom function in wordpress to return data from database
- Getting URL of Resized Image
- Adding a new layout for genesis
- themeforce (happytables framework) implementation
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- How do I work with responsive images in WordPress? (img srcset/sizes)
- Is there any filter or action hook to remove layout classes from appearing in my templates?
- I want to resize post featured image without cropping image. How?
- Only show read more text when when wp:post-excerpt meets excerptLength
- No src and sizes attributes present on WordPress thumbnail images; the smallest image size is loaded irregardless of viewport size
- add_image_size() parameter four ($crop = true) is ignored: the_post_thumbnail() returns scaled image(s) instead of hard cropped