WordPress: Enabling Category Images

Michael Mann
Out of the box, WordPress does not enable images to be used for post categories. This can be enabled through the use of the Category Images II plugin.

Installation

Download category-images-ii.zip and extract on your computer. Upload the entire category-images-ii directory to your /wp-content/plugins directory. Log into the WordPress and click Plugins on the left side of the page. Under Actions (right side of the page) click Activate.

Using FTP, visit the wp-content/upload/ folder and there should be a subfolder named category-images-ii. Set the permissions on this folder to allow for category images to be placed here. 777 should work.

Adding Category Images

Click the downward arrow to the right of Post (first item under Dashboard). Click Categories.

To add an image to an existing category, click the category name to edit the category. Near the bottom of the edit category page, you will see "Upload a Category Image". Click Browse. Navigate to the location of the image you wish to use on your computer. Select the image file and click Open. Click Update Category.

Adding Category images to Theme

Prior to category images becoming viewable, you will need to add the following to the desired page for the theme being used by WordPress. Using the default theme as an example, to add category images to the main page in the index.php file under wp-content/themes/default look for the following:

This will start pulling in posts from the database. Add the following code at the desired place inside this while loop.

< ?php ciii_category_images(); ? >

(remove spaces from < ?php and ? >)

A recommended place would be right after the h2 for the post title the_title() (before the a href). Save index.php and re-upload the file.

Modifying Category Image Appearance

By default, the category image is displayed inside an unordered list. To remove this feature, copy the view folder under wp-content/plugins/category-images-ii to your theme folder (using the default theme again) at wp-content/themes/default/view/. Edit the file at wp-content/themes/stblog/view/category-images-ii/category-images.php by removing all ul and li tags.

Now your category image will show to the left of the article title for each posting. If no category image set, none will be displayed.

Published by Michael Mann

With over 12 years of professional experience as a Web designer and over 20 years of general computer experience, I am often the "resident tech". I own and operate Michael Mann Desktop Publishing, a desktop...   View profile

8 Comments

Post a Comment
  • stefano 1/16/2012

    When i try to activate the plugin wordpresse send me this notification:


    This plugin admin template could not be found: /templates-admin/options-page.php

    someone can help me?

  • Michael Mann 4/3/2011

    Steve, What version of WordPress and what version of the plugin are you using?

  • Steve 4/3/2011

    I really need help I uploaded the plug-in and activated it and placed an image for a category but it doesn't show up can anyone help me with this problem ?

  • NetIngenuity 11/18/2010

    I'm lost and could use help figuring out which file and where in that file to insert <?php ciii_category_archive_image(); ?> in order to fit a single image above the category archive. I have a custom theme in wp-content/themes/customtheme. Which file should I open and where does the code belong?

    TIA!

  • Michael Mann 6/19/2010

    It appears the code to place in the index.php file got stripped. It is italicized now. Hope this helps!

  • D. Garrett 6/13/2010

    Hi Michael. It looks like some of the code you posted in this article got stripped. I've tried viewing it in Internet Explorer and Firefox and nothing is showing up.

  • Michael Mann 7/16/2009

    Sundain, glad this was useful for you.

  • sundain 7/16/2009

    Thanks this tip will help my site http://anime-eater.com where i have been having trouble finding this plugin.

Displaying Comments

To comment, please sign in to your Yahoo! account, or sign up for a new account.