Get the Image does what you need and better. It’s NOT overwhelming with lots of unnecessary features, and does what it says. Try it to see if it does what you need.
How does Get the Image plugin pull images?
Looks for an image by custom field (one of your choosing).
If no image is added by custom field, check for an image using the_post_thumbnail() (WP 2.9’s new image feature).
If no image is found, it grabs an image attached to your post.
If no image is attached, it can extract an image from your post content (off by default).
If no image is found at this point, it will default to an image you set (not set by default).
Related Posts:
- Missing feature image link function
- Why isn’t is_page working when I put it in the functions.php file?
- Show modified time if post is actually modified
- AJAX handler throws 400 (Bad request) – why?
- Get recent posts with thumbnail
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- Add options to featured image
- Generating Responsive Background Image Sizes in PHP
- Why are image thumbnails cropped proportionally (not per dimensions)?
- WordPress – thumbnail image from youtube (function and loop)
- Make WordPress size and name images for Retina.js
- Why are image thumbnails cropped proportionally (not per dimensions)?
- the_post_thumbnail fallback using hooks
- Adding WooCommerce to a Custom Theme – not working [closed]
- A snippet after every image
- Setting featured image with function, 1 part not working
- Function to show only first instance of shortcode
- Automatically insert php function into post $the_content
- Creating loop within functions.php
- Removing the first image in content
- Display WooCommerce subscriptions for user [closed]
- How to use max and min values of custom fields
- Filtering posts by category name based on page’s slug
- img width and height attributes being set by get_the_post_thumbnail
- 2 Loops, Only Displaying 1 Loop in Both Loops
- Get the 5 lastest Featured Posts from a category
- How to display a default image for post thumbnail using functions.php?
- Getting Featured Image Caption to Only Show if Populated
- wp_get_attachment_image function size argument not working if I also add a custom class
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Add Featured image column into wordpress admin on pages AND posts
- Post thumbnail not showing in WP admin area for custom post type
- Overwriting Parent Theme’s Image Sizes
- Backstretch.js and thumbnail sizes to reduce loading time
- set_post_thumbnail when user is not logged in
- Having a Function Inside of the Loop
- Getting different functions data while using while loop in wordpress
- How to stop twenty fifteen theme from cropping featured images?
- Create a new query in function.php to filter blog posts
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- show first 3 thumbnails of posts in different sizes [closed]
- Limit length of first excerpt in the loop
- Set spesific size of featured images
- Default Custom Field Value Automatically Update
- Can’t generate thumbnail images
- Multiple Loops Meta Data
- Why doesn’t is_page(id) work in functions.php?
- It does not work concatenation in function.php
- How to retrieve the current post’s generated featured image size?
- Check if the image size is available and if not use ‘full’ image size
- While loop with an exception after a count is reached
- is there a way to remove featured image from blog page and single page
- How do I pull excerpts from pages?
- Conditional statement not working in function
- Output loop to function return?
- Can set_post_thumbnail be used to remove a thumbnail?
- issue with if/elseif in_array inside foreach loop display only one post
- Can’t locate custom image sizes defined by child theme
- Problem with calling custom function in a foreach loop
- Get term slug by term id and then explode it
- Using functions.php to include code that’s processed inline
- How to add a new image size and apply it to posts only?
- Breaking up multiple words and inserting an image after first word
- Show Featured Image in else statement
- Change custom featured image size in twentythirteen child theme
- resizing of thumbnails not working
- show all the posts thumbnails
- include w_thumbnail_src in function?
- Simplest Way to Build Custom Archives Page?
- Woocommerce Variable Product Dropdown for Custom Shop Template
- Custom image sizes showing in Classic Editor only when upladed directly to post
- the_date() and the_time() functions display actual date an time instead of published date and time
- Which filter fires upon setting a featured image
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- remove_filter function to unhook twentysixteen parent theme function
- How set a while with a function
- Pass post ID from archive template to functions file
- How to use `foreach()` in ajax call
- Featured image on archive page based on post type
- Printing medium sized image
- Sticky – Featured Image
- Code executes outside of Loop while same code gives ‘Uninitialized string offset’ notice inside a while loop
- Frontend Feature image upload not work
- Only seems to be displaying one child when there are supposed to be multiple
- Remove Featured Images from Posts Older Than a Certain Date
- How to display content If function exist/condition true?
- Function to get the name in database table from the comma separated string
- Set thumbnail from URL, by grabbing image in functions.php
- Full size image option removing problem
- Way of getting queried loop before the query with a filter hook?
- Post variables not displaying correctly in custom function
- Image width issue in IE [closed]
- how to handle multiple forloop?
- Creating mixture of shortcodes to use in the visual/text editor
- image_size with respect to aspect ratios
- Is mytheme_post_thumbnails() still necessary?
- Get full slug for a WordPress Post
- Update post meta with wp cron
- Second featured image only shows in metabox preview after saving a post in the wordpress editor
- No src and sizes attributes present on WordPress thumbnail images; the smallest image size is loaded irregardless of viewport size