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
- The the_post_thumbnail without srcset?
- Get the first image from post content (eg.: hotlinked images)
- Using classes instead of global functions in functions.php
- What is the difference between wp_register_sidebar_widget and register_widget?
- What filters are applied to the_content function?
- How to modify an image block in Gutenberg WordPress 5?
- wp_get_attachment_image_attributes not working for me
- Display a different theme for not logged-in users
- Why might $input (Settings API) be coming through empty?
- How to Auto Approve Comments on a Specific Page?
- How to overwrite youtube embed?
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- Merging PHP download script into `functions.php`
- Passing variable in hooks and filter
- Is there an error in get_the_tag_list()?
- Returning Variables back into a template
- How to handle thumbnails
- Allow users to add custom functions to wordpress theme
- How to add custom template tag in wordpress theme?
- WordPress nav_menu_css_class theme filter is not being called
- How to regenerate thumbnails when they’re stored on S3
- customizing the_password_form filter
- Cannot get full thumbnail size using the_post_thumbnail
- How can I customize wp_footer, where is the code that controls what this function does?
- How to list all images in uploads directory except those that are attached to any post
- Change file name from wp_generate_attachment_metadata
- More than one meta field in a single meta box?
- Is there a theme function for is_password_protected()?
- Toggle Sidebar Display
- How to store functions in… functions.php?
- Simple way to get two language WP site
- Can’t show custom post thumbnail sizes as background images
- Should I use include or load_template for including shortcodes, plugins and so on?
- Check if home.php and set home.php as page_on_front
- Highlight “Show all” item in wp_list_categories
- Display recent posts with thumbnail
- Reasons why all thumbnail sizes aren’t working
- How do I Add images uploaded in the post to a default custom field
- How do I build a post_thumbnail based archive? [closed]
- WordPress taxonomy and archive custom class
- Filter categories used with Custom Structure Permalink
- How do I turn a post thumbnail into a background image?
- 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
- 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 →
- 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 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)
- Full width featured thumbnail
- 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
- Add image URL automatically to custom field?
- content filter (add_filter) for category description?
- Related Post Category Filter
- theme directory fallback image outputs url and not the image
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- remove_filter function to unhook twentysixteen parent theme function
- Alternative solution for script_loader_tag?
- 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 to add custom nav_menu_css_class to certain menu only?
- How to manipulate wordpress template tags’ output
- WordPress permalink setting
- Featured Image Module Randomly Disappears
- Single Featured Image Repeating
- 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
- 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
- Getting URL of Resized Image
- Adding a new layout for genesis
- 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?