You should remove this part:
<?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { ?>
<div class="widget-img">
<a href="https://wordpress.stackexchange.com/questions/116533/<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('lists'); ?></a>
</div><!--widget-img-->
<?php } ?>
.
Just to explain… This conditional statement askes… if there is a thumbnail run the code in between me and my closing tag…
<?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { ?>
<?php } ?>
This part “echoes” the thumbnail container (div) & its href wrapper & the thumbnail itself.
<div class="widget-img">
<a href="https://wordpress.stackexchange.com/questions/116533/<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('lists'); ?></a>
</div><!--widget-img-->
Related Posts:
- wordpress custom walker for thumbnails with custom menu
- Image Editor does not affect custom sizes!
- Hide upload image fields for the different media upload popups
- how i can increase Featured thumbnails size?
- Using custom image resizing script in a page
- Post thumbnails not working in my new install of WP 3.1 with Twenty Ten theme
- the_post_thumbnail() returns nothing even though has_post_thumbnail() returns true
- Featured Image If Else Condition
- Replace TimThumb in existing WordPress Themes
- WordPress 5: including larger thumbnail image sizes in srcset than I have set
- I want to use a product thumbnail completely different than the product image
- How to add the option to choose between sizes for featured image within post editor?
- duplicate featured image functionality in custom meta box
- Upload image without resizing but insert in post with resizing
- Get a different size of Image thumbnail while working with custom metabox
- WordPress uploads directory. Featured Images storage
- How can I get the Media Library backend to show larger thumbnails?
- How to: Easily Move a WordPress Install from Development to Production?
- Is there a flowchart for WordPress loading sequence?
- Essential technical features for high-end WordPress web hosting? [closed]
- How to remove admin menu pages inserted by plugins?
- How to put logs in WordPress
- How to get the Date Format and Time Format settings for use in my template?
- Where are Additional CSS files stored
- Best Practices for Regression Testing WordPress Websites?
- Remove wrapping div and ul from output of wp_nav_menu
- What Is The Use Of map_meta_cap Filter?
- get post author id outside loop
- Custom Walker: how to get ID in function start_lvl
- Creative uses of WordPress [closed]
- How to disable WordPress from creating thumbnails?
- How to *remove* a parent theme page template from a child theme?
- How do I make my child theme re-apply the settings that were customised when its parent was active?
- Multiple Inputs in a Customizer Control
- New WP_Customize API – how does it work under the hood?
- Embedding a SOAP Client into a WordPress Plugin?
- Is there anything that Joomla or Drupal can do that can’t be done in WordPress? [closed]
- Update widget form after drag-and-drop (WP save bug)
- Data sanitization: Best Practices with code examples
- set_post_thumbnail_size vs add_image_size
- How to benchmark a WordPress installation? [closed]
- Should I delete the default themes?
- Moving WP install from local to live, what about wp_posts GUID?
- Modified wp.media.view.Settings.Gallery in Backbone JS, but editing doesn’t work
- Running Gutenberg React in Development Mode
- Prevent WordPress from automatically installing a new theme each year
- Can we use one WordPress installation for multiple databases, domains and content directories
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Plugin SVN & update API – how are plugins identified?
- Users with custom roles not showing in post author select box
- How to use more than 256MB of memory in the admin?
- How do register_sidebar() and get_sidebar() work together?
- How do you get formatted content of a post using the WordPress API?
- the_post_thumbnail responsive srcset not populating with custom image size
- Set custom name for generated thumbnails
- Localization: I want the backend: english and frontend in defined language
- Are there any forks of WordPress (and what is different about them)?
- How to Change 404 page title
- Make Custom Metaboxes Collapse by Default
- WordPress Paginate $wpdb->get_results
- Custom maintenance page
- Add button to TinyMCE bar without creating a plugin
- New image size version only for the Featured Image file
- Why do I get the timeout warning?
- wp_get_attachment_image_src always returns full-sized image
- How to add a new product type on woocommerce product types? [closed]
- How to include own css on wordpress tinymce editor?
- How to disable page delete
- add button to post edit page when post_status=publish
- Add Title Attribute to WordPress Image the_post_thumbnail
- how to override woocommerce specific loop or archive-product.php [closed]
- Modify existing plugin function using filter (without modifying the plugin directly)
- Rename UPLOADS folder with custom WP_CONTENT_DIR
- WordPress hook before inserting post into database
- Any post install tips after installing WordPress 3.0.1?
- Making Custom Fields Standard in the Admin UI
- Remove WordPress theme from a specific page
- Is there a hook which fires after all thumbnails are generated?
- Version Control: Entire site or just pieces?
- Getting a stack trace when an error occurs?
- Check for and enforce unique value in user-entered custom meta field in WP Admin
- Backup the Database and Restore from the Backup?
- get_pages() not ordering as it should
- Scaling a WP eCommerce site
- Custom Search Query
- How to remove comment section from page only , not from posts pages?
- Looking for a lightweight theme using WP3 new tags and features (not 2010) [closed]
- Why doesn’t WP_Image_Editor save images using the Filesystem API?
- Pitfalls when Distributing Plugins that Access SOAP Web Services?
- How to get current_cat in navbar, in single post
- Default value for add_settings_field
- Seamless integration between WordPress and BBpress
- WordPress 3 MU for a development/stage/production site
- Disable Visible Edit Shortcuts in the Customizer
- How to make a script load after Custom Block is loaded in the editor?
- Updating WordPress overwriting customization tweaks – strategies?
- What is the best way to customise admin files so they survive future upgrades?
- Hide admin notices/notifications from everyone but super admin?
- Change the login button on the login page
- How to customize the default HTML for WordPress Attachments