Try to replace the block in the middle of the query with this code:
<?php if ( has_post_thumbnail()) {
the_post_thumbnail();
} else {
the_title( '<h4>', '</h4>');
} ?>
Related Posts:
- How do I change/modify the_post_thumbnail(); html output?
- What’s the best way to use the Featured Image for responsive web design?
- How to count the length of a post title?
- PHP/Manual use of images? – 2 Questions
- Filter the blog title displayed in the header
- Adding Featured Image to Post programatically
- Blank on static home page?
- How to upload imagick resource to media in wordpress
- How to add a featured image to a existing post via php?
- How to use SRCSET with get_the_post_thumbnail()?
- “Maximum function nesting level of ‘100’ reached” after adding a new filter
- String replace WordPress Site Title
- Adding featured image via PHP
- WordPress loop specific thumbnail size
- How do I get images (with a thumbnail preview) to show in search results?
- fallback image for featured image
- Customized title tag for each page in pagination?
- How to get Poster (thumbnail) Image of Video
- WP Insert Post function – Insert Post Thumbnail
- Display All Post Attachments and Assign Class to the Last Image?
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Assign a picture URL to a page via PHP
- Browser title script ignoring is_page /else conditional [closed]
- Blank space at beginning of tag?
- Filter get_the_title to remove certain characters?
- How to scale image with equal width and height without distortion?
- get_page_by_title with an apostrophe in variable
- Featured image fallback link to permalink
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- How to Display Image Meta underneath EVERY image in EVERY post
- How can I show the post thumbnail from the most recent of a certain post type, in widget?
- Locating Global Variables
- How can I add pagination and how can I change thumbnail size?
- Set post title based on first h2 element in the content section
- Echo URL of large version of Featured Image
- An extra ‘ is displayed in the title
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- Trying to add attribute to my posts’ featured image
- Part of title duplicating but not sure how to remove from code – help?
- Recent posts with featured image or fallback image with permalink
- Randomly Assign an Image’s Alt Text Based on Data From Post
- WP dynamic featured image – Can’t get second featured image url
- Set the background to a default image if there isn’t a specified “featured image”
- PHP variable = get_the_post_thumbnail_url outputting without slashes
- Is it possible to use Data URI image to set a post thumbnail?
- WP Post-Thumbnail
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Remove the first 5 characters of the_title and orderby that
- Change title only in dynamic page
- post thumbnail, conditions, else wont work
- ‘Post-thumbnails’ feature does not seem to register
- height should be set to auto to avoid pixelation in the post thumbnail function
- Change page title from page using php via php executed from page/post itself
- Three Questions with Twenty Eleven theme
- Display related posts without a plugin
- Reduce size of responsive title
- Run str_replace on title and save the output to a custom field
- WordPress function and string as variable?
- Resize image to specific dimension (X to Y ratio)
- Apply class to every third list item? [duplicate]
- Echo title attribute php
- Automatically add images to a menu
- Using featured image of blog archive page
- change title page on search result
- if custom field doesn’t exist, use post thumbnail instead, as image background
- woocommerce related product title length
- Help Fallback (thumbnail)
- Get featured image with custom size outside WordPress
- Split site title and apply different classes
- How to add post thumbnail dynamically using Jquery?
- Else/If Statement to Display Photo Descriptions
- How to set a featured image (thumbnail) with PHP?
- Replace Underscore (_) on Space ( )
- Basic PHP question (displaying post title over thumbnail) [closed]
- Showing featured image of page’s child’s children page
- insert thumbnail image from php script
- my site show this symbol (::) between site title and tagline
- Can’t put a hyperlink on Featured Post’s Image
- add class to background image
- Display tab title as ‘blog tagline | blog title’
- News and Featured image
- How to correctly add the featured immage (thumbnails) support in a WP theme? Why I can’t add a featured immage?
- Overwriting a Shortcode
- featured post as div background
- How to display thumbnail if post is assigned one otherwise not
- Custom field in title
- Post Thumbnail on Single (if elseif else)
- the_post_thumbnail unless video id is added
- Setting post thumbnail sizes in template file and functions.php
- Hide page title
- How can i give a download link to the thumbnail or featured image
- add if statement to the featured image
- How to crop featured image in different sizes?
- Remove default Image Sizes
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- Generate and upload screenshot as featured image for user-submitted post
- Getting a specific “title for a section” only on Startpage?
- Restricting Image Upload Sizes using ‘wp_handle_upload_prefilter’ – Stuck media progress bar when Featured Image?
- Split titles by the ” – ” in WordPress
- Is it possible to remove the “Shop” title from the WooCommerce catalogue? [closed]