Check out get_the_post_thumbnail()
$image_thumb = get_the_post_thumbnail( get_the_ID(), 'thumbnail');
Here’s a more specific example:
while (have_posts()) : the_post();
echo '<article class="search-entry clearfix">';
$image_thumb = get_the_post_thumbnail( get_the_ID(), 'thumbnail');
echo ( $image_thumb ) ? sprintf('<a href="https://wordpress.stackexchange.com/questions/168885/%s" title="https://wordpress.stackexchange.com/questions/168885/%s" class="search-portfolio-thumb">%s</a>', get_permalink(), get_the_title(), $image_thumb) : '';
Related Posts:
- How can I get the title attribute from get_the_post_thumbnail()?
- Set Featured Image for Archive templates
- How can I add a set featured image function to a theme that doesn’t already have it built in?
- How do you get thumbnails to show up in the admin edit post?
- 100% width Featured Image Size
- Featured images, am I missing something?
- Recommended Media Size for Twenty Fourteen
- get_the_post_thumbnail() produces different HTML on same arguments
- Migrating a website using custom image tags to use featured images instead
- How do I get the featured image to sit below the header in the twenty nineteen theme?
- Edit box-header on WordPress Dashboard
- Featured images are cropped on index and post page
- Theme stops media uploader from working
- How to change background color in the Notepad++ text editor?
- What are all the available parameters for query_posts?
- Is it OK to remove theme credits from footer? [duplicate]
- What theme is good for posting code? [closed]
- Difference between stylesheet_directory and template_directory
- How to see files in directories in “Edit Themes” screen
- WordPress generating 404 on .mp4 file in theme folder
- Why are my widgets not saving when being added to a sidebar?
- Building useful features into your theme
- How to remove “Proudly powered by WordPress” in Twenty Sixteen (2016) theme?
- Editing theme files and access to the Code pages only to super-admin?
- Edit theme wp_head
- Current theme broken – after server and domain migration
- Enqueue different stylesheets using IE conditionals
- Categories for Pages Not Saving in Admin with Custom Categories Metabox?
- Switch Theme Through Options Panel
- Weird post pagination url redirect
- How get Themes list via REST api?
- Activate a new WordPress Theme Only for Admins
- WordPress Fatal error: Call to undefined get_header() in index.php on line 15 [closed]
- How do I copy my Parent Templates to my Child Templates?
- How can I show more than 15 themes at a time in the admin menu?
- Theme Editor Not Showing
- Pros and cons of using Backbone for WordPress theming [closed]
- Can I create multiple instances of the BuddyPress Activity Stream with separate themes? [closed]
- Can I rename a theme’s folder and still receive updates?
- Child theme not visible
- How to load parent theme style.css?
- How to setup a new WordPress theme without deactivating the current theme?
- WordPress is not able to change themes
- How do I set the featured image size on the single post?
- Where all are child themes recorded when they are created in WordPress
- I have some doubts regarding how to implement child theme
- Inconsistent translation on a WP site
- Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10)
- how to remove category nav from Bueno (WordPress Theme) header [closed]
- How can I have different theme with same booking table? [closed]
- Web site Header tag links some resources with HTTPS
- How to style the post previews/links without it affecting the main posts?
- customize color in WP child theme doesn’t saved
- How to work on a new Theme for a site while still keeping the old Theme live
- Loading Bootstrap with wp_enqueue_style and wp_enqueue_script
- WordPress use of @ in core files
- Unable to upload/install any WordPress themes
- Change the name of the root name of an already built WordPress theme
- How to switch theme if the current user is admin?
- Cannot apply custom css to IE in the theme
- Getting a ‘slide down’ js panel implemented within WP
- Why does wordpress add Theme not list a specific theme anymore?
- WordPress theme layout problem
- current_user_can(‘manage_options’) causes white screen of death?
- header.php-tweak: How to do that getting Meta-Slider into the header-center?
- enqueue_script doesn’t work with HTML5 blank theme
- Get WP Install Directory
- WordPress | Theme error
- Fix threaded comments
- Using DePo Masthead with WP 3+
- How to get this taxonomy name from wp_get_object_terms()?
- Load elements without reload page [closed]
- How to change wordpress gutenberg editor font to match default theme font?
- Facebook Icon on top of WordPress Site Header and Top Bar
- Any way that guest users see the site as registered users?
- Webflow Interactions on WordPress site?
- How to make wordpress theme option page in columns?
- 404 not working, going to homepage; how to fix?
- Local LAMP Stack on Linux Mint theme upload fails
- WP Snippet to Hide Theme Editor In Dashboard Only Works On LocalHost Site
- WordPress 404 on style.css but not on all pages
- How do WordPress themes work in relation to content?
- Custom CSS is overwritten by WordPress?
- Incorrect Theme and Upload URLs After Migration
- Is there significant risk in not keeping a theme updated? [closed]
- Using two stylesheets for mobile compatibility
- Copy from wordpress for dev gives different output in browser
- When translating not all string are present in POedit
- Featured Image Module Randomly Disappears
- Target Internal Link Of Another Page On Website
- Change whole theme depending on resolution
- post_prev & post_next within same category
- Costum Theme template directoy url problem
- How to find out which template the HTML content comes from?
- What is the general cut-off date for reviewed themes in the WordPress.org repository?
- Include root files into header files
- Commenting in CSS (//) equals “none”? [closed]
- How to add Company Logo to Chosen Theme
- What security risk is not having “default” theme?
- problem with custom url for images as post