Set images for categories and tags, especially for fallback post thumbnails or featured images.
Category Featured Images Extended (CFIX) can ensure that posts, category archive pages, widgets and other elements of your site will always display a thumbnail or featured image* when called upon to do so by themes, templates, and plugins.
If a featured image has been individually set for a post, it will be used. If a featured/thumbnail image has not been set for a post, CFIX will first try to supply an image from one of the post’s categories or tags. It will use a Yoast SEO “Primary” Category’s image if available. If no category or tag image is found, the plugin will look for a parent category with an image. Finally, if no linked or related post, category, tag, or parent category image is found, a particular fallback tag or category image can be used if set as “global fallback.”
This plugin was initially based on “Category Featured Images” (CFI) by Mattia Roccoberton. If you already have been using CFI, when you install this extended version, your already saved category image settings will be preserved and copied.
In CFI
In CFIX
NOTE: IF UPGRADING FROM CATEGORY FEATURED IMAGES, DE-ACTIVATE IT TO AVOID CONFLICTS
As a further precaution, do not uninstall CFI completely until you are sure that CFIX is working as expected for you.
* The terms “thumbnail” and “featured” are used somewhat interchangeably in WordPress, even though many featured/thumbnail images will be displayed at much larger than thumbnail size.
Check the CFIX home pages for additional background, examples, documentation, and usage tips… or to contact the developer directly.
All gratitude to Mattia Roccoberton for the basic code for his original Categorey Featured Images plug-in, which I had been using for years before I got around to extending it. Thanks to John Prusinski for recommending the Yoast SEO modification, encouraging me to implement it, and even throwing in a tip via Paypal! Thanks also to all of the developers and everyday code-hackers, far too numerous to name, upon whose work I have depended.
Assuming that you’ve cleared any caches that might be affecting display, and that you’ve properly added the relevant category images, one possibility is that your post data (“Post Metadata”) was corrupted or incompletely inserted during a restore, import, or other operation, and that WordPress wrongly thinks that your posts have thumbnail or featured images when they don’t really. Many relatively well-tested, widely and even very widely in use WordPress plug-ins and functions will produce this “thumbnail false positive” behavior.
CFIX has been written to provide a thumbnail image even in such cases, but please contact the developer if you encounter such an outcome, as the plug-in is still new, and use cases are still being assembled. For instructions on Flushing Bad Thumbnail Data see CFIX Advanced Topics.
CFIX WILL add some overhead, especially if your layout features large numbers of posts calling for thumbnails or featured images that have not been set, requiring the plug-in to work overtime to find fallbacks. Slowed page loads should be mitigated with proper use of good caching applications – which you ought to be using in any event, especially if utilizing image-rich multi-post displays, and depending on the plug-in to provide a large number of substitute images.
Fixed parameter transposition error in category-featured-images-extended.php affecting excluded categories vs. Yoast Primary Category
Fixed offset non-definition throwing PHP Notice