Category Featured Images

plugin banner

Set a featured image for all the posts of a category.

Author:Mattia Roccoberton (profile at wordpress.org)
WordPress version required:3.5.0
WordPress version tested:4.1.40
Plugin version:1.1.8
Added to WordPress repository:25-04-2014
Last updated:29-01-2015
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:90
Rated by:11
Plugin URI:https://github.com/blocknotes/wordpress_categ...
Total downloads:19 780
Active installs:1 000+
plugin download
Click to start download

This plugin allows to set a featured image for each category.
Posts without a featured image set will show the category’s featured image instead.
Featured images usually are placed by the theme in the single post page, in the latest posts page, etc.
But can also be shown using the shortcode [cfi_featured_image] or the PHP function cfi_featured_image(). To get the featured image URL I added the function cfi_featured_image_url().

Shortcode/PHP function optional arguments:

  • ‘size’: ‘thumbnail’, ‘medium’, ‘large’, ‘full’
  • ‘class’: class of the image tag
  • ‘alt’: alternative text of the image tag
  • ‘title’: title of the image tag
  • ‘cat_id’: select a specific category id

Shortcode example:

[cfi_featured_image size="large" title="This is a test..." class="my-image" alt="My image"]

Function example 1:

cfi_featured_image( array( 'size' => 'large', 'title' => 'This is a test...', 'class' => 'my-image', 'alt' => 'My image' ) );

Function example 2:

cfi_featured_image_url( array( 'size' => 'large' ) );

Notes:

  • If a post has more than a category with a featured image the first available is loaded
  • If a category hasn’t a featured image but it has a parent category with a featured image the parent one is loaded

Screenshots
ChangeLog