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?
- Get the blog page URL set in Options
- Issues with title-tag and document_title_parts
- Get the first image from post content (eg.: hotlinked images)
- How to remove the Theme Customization Button from the dashboard and themes options page?
- How to modify an image block in Gutenberg WordPress 5?
- Create “File-less” Page Template in Functions.php
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- How to add a 2nd “featured image” to a post?
- When to use esc_url, esc_html, esc_attr, and friends?
- How to edit bbPress template files – WordPress + BuddyPress + bbPress? [closed]
- Run shortcode before filters
- Add class to before_widget for all widgets with a dropdown and a counter
- Why might $input (Settings API) be coming through empty?
- Unexpected width and srcset attributes for the_post_thumbnail();
- Override default cropping in WordPress [duplicate]
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- Removing the default sidebar from admin panel
- Merging PHP download script into `functions.php`
- Change date number to another language/script?
- Nesting Functions within Functions
- Is using eval() ok in this scenario
- Change display of featured image for pages in twenty seventeen theme
- Custom php page in WordPress theme?
- How to set dimensions of the post thumbnails (featured images)
- How to add oEmbed support to my theme?
- Can’t access WordPress functions in file called via Ajax?
- WordPress Genesis Child Theme Filter divs
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Change file name from wp_generate_attachment_metadata
- Show excerpt for only first post in query
- how do you create an admin interface in plugin for your theme
- How to determine which custom header image is being shown
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- trying to use wp_handle_upload with ajax
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- When trying to override plugin’s function by theme, my filter executes two times, I want it to run only a single time
- Responsive embed for the video shortcode
- Featured Images are not able to be set
- Menu item added in wp_nav_menu_items filter is never highlighted
- after renaming my wp-content folder, how do I upgrade my wordpress version?
- How do I Add images uploaded in the post to a default custom field
- How do I add custom bulk actions to multiple custom post types?
- WordPress taxonomy and archive custom class
- 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
- How to rotate every letter in a title
- Issue on Getting Custom post type Thumbnail’s URL
- How To Pick Custom Size Of Uploaded Image In Theme Via the_post_thumbnail();?
- the_post_thumbnail() get the URL to the “medium” sized image
- CSS class on last post in loop ( custom query )
- 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 scale down the width of images in bulk that are embedded in posts throughout the site?
- Related Post Category Filter
- Pagination don’t work with active filters
- How to register dynamic settings in WordPress Customizer?
- restrain filter on get_the_excerpt to queried item in stead of current post
- WordPress wp_get_current_user returning blank values until refresh
- Created blank theme for REST API, featured image not appearing on admin side
- Alt header logo and link for specific pages
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- 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
- Featured Image Module Randomly Disappears
- what is do_action(); in wordpress? [duplicate]
- Apply height and width for the_content() inside youtube video tag
- 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
- loading custom.js file after jquery is loaded
- Show post thumbnail only if it exists using timthumb
- themeforce (happytables framework) implementation
- How do I work with responsive images in WordPress? (img srcset/sizes)
- I want to resize post featured image without cropping image. How?