Something like this?..
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>">
<?php if ( has_post_thumbnail()) { ?>
<div class="post-thumb">
<?php the_post_thumbnail(); ?>
</div>
<div class="post-entry-1">
<?php the_excerpt(); ?>
</div>
<? } else { ?>
<div class="post-entry-2">
<?php the_excerpt(); ?>
</div>
<?php } ?>
</div>
<?php endwhile; ?>
<?php else: ?>
<p class="no-data">
<?php _e( 'Apologies, but no results were found.' ); ?>
</p>
<?php endif; ?>
Related Posts:
- How do I regenerate thumbnails?
- Add Title Attribute to WordPress Image the_post_thumbnail
- Replacing Gutenberg Featured Image control?
- oEmbed, thumbnails and wordpress
- How do I add the featured image to the_content after the first paragraph?
- the_post_thumbnail scaling not hard cropping
- How to show featured image CAPTION only if it exist
- Featured Image Inherited from Parent Page
- Change wording of default thumbnail metabox
- Specific featured image for each category
- how to pull images with no add_theme_support(‘post_thumbnails’)
- Can WordPress crop only the post thumbnails?
- Query the post which have a thumbnail
- Featured image for news page
- How to show a featured image as current?
- How can I get a different image size, if all I have is the link?
- Show current page featured image in sidebar
- Importing featured image to posts, duplicates the image
- wp-cli regenerate media is not working for custom sizes
- How do I set a featured image (thumbnail) by image URL when using wp_insert_post()?
- Use post thumbnail as div background
- How do I set the default “feature image” size?
- Featured Image missing in WordPress 3.2 Admin
- Post Thumbnails multiple sizes
- Change post thumbnail using front end post edit form
- Featured image thumbnail sometimes in content, sometimes changes header images
- How to add multiple featured images to post/page without a plugin
- How do I set “Upload Image” as detault “Set Featured Image” window?
- Function to replace the url of featured images in the wordpress database?
- has_post_thumbnail gives always TRUE
- Displaying wordpress image size as array used for page builder
- Setting a default placeholder image WITHOUT link
- If I Regenerate Thumbnails, would WordPress delete the existing Thumbnails and replace them with ‘new copies’?
- how to use first post image as thumbnail on wordpress
- Make the first image the post thumbnail without setting it as the featured image
- set a chosen image-file-input as a featured image from wp frontend
- Aligning the thumbnail image
- How do get post thumbnail into plugin?
- Default Featured Image from Post content
- upload or auto setup feature photo by user avatar
- wp_get_attachment_image_src match smallest edge
- How to replace featured image upload option with the post media image option
- How to create resized versions of images added with wp_insert_attachment
- Can I insert the feature image inside the content, after any paragraph?
- Set Post Thumbnails in Percents
- WordPress returns old thumbnail size after changing media settings
- get_the_post_thumbnail() returns nothing?
- Display a thumbnail outside of the loop for a page
- How to use get_the_title with text on the ‘alt’ of the_thumbnail array?
- remove_image_size doesn’t seem to be working
- Get Featured Image Outside Loop Not Working
- Responsive scaling of image for the_post_thumbnail() [closed]
- images not showing despite using add_theme_support(‘post-thumbnails’);
- post thumbnail: increase dimension if smaller than… Possible?
- How do I make images appear in the beside blog post summaries?
- Displaying caption with featured image
- add_theme_support post-thumbnails not working
- Trying to show WordPress category query result as background image
- How risize a thumbnail?
- custom thumbnail image size not working
- Comparison Operators not working for conditional author post thumbnails
- Assign SQL ‘post_thumbnail’ column as featured image
- Default thumb – how to set it
- Add image size array to a portfolio thumbnail in combination with Masonry Jquery Plugin
- Define width of featured image thumbnails, but also make responsive?
- Add title to image post
- How to attach images that I “insert from url” into the post?
- How to update custom image sizes?
- featured images twenty eleven theme
- Picture inserted in the post not showing in “Gallery”
- How to add featured images to posts from a category
- featured image is not showing
- Change featured image when changing viewport
- How to change the format of thumbnails into wordpress theme?
- How to calculate the sum of all featured thumbnail height on WordPress?
- Adding guiding text to the ‘Featured Image’-box in the backend
- How to create thumbnails programmatically?
- Usage of add_image_size (for featured image)
- Featured image: Dynamic image sizes when enlarged with javascript
- Smaller Size for featured images
- Featured image doesn’t appear in Blog index
- Remove Featured Image based on Date
- set_post_thumbnail() shows Unattached on backend under Media
- How to show only 2nd featured img on home/blog
- Echo recent posts each with its own respective featured image
- How to get post thumbnail to be equal to set media size
- Add notice to add image popup
- Mass/Bulk assign featured images to posts
- setting featured image is not working while running script in background, works when running that script from browser
- Get all images from posts with maximum number and without featured image
- How to modify responsive images in post thumbnails
- get_the_post_thumbnail() – Invalid argument supplied for foreach() in /wp-includes/post-thumbnail-template.php on line 64
- Different thumbnail size than actual picture in post
- How to get the featured image inside of a single-.php template?
- Change featured thumbnail based on screen size
- Where is the template from the_post_thumbnail()?
- Get Post Thumbnail Outside of Loop
- Theme:Twenty Fourteen, How to remove featured image on single post page for particular category
- Show a featured image with “Link” Post Type?
- Hot to change resized image link on posts