## Category Thumbnails

Category Thumbnails is a theme feature. Category Thumbnail is an image that is chosen as the representative image for Categorys, or Custom Taxonomys. The display of this image is up to the theme. This is especially useful for "magazine-style" themes where each category has an image.

### Enabling Support for Category Thumbnails

Themes have to declare their support for post thumbnails before the interface for assigning these images will appear on the Edit Post and Edit Page screens. They do this by putting the following in their functions.php file:

    add_theme_support('category-thumbnails');

### Setting a Category Thumbnail

If your theme was successful in adding support for Category Thumbnails the "Thumbnail" button will be visible on the on the category screens. If it isn't, make sure "Category Thumbnails" is enabled.

### Function Reference

Template Tags
`has_category_thumbnail()` `the_category_thumbnail()` `get_the_category_thumbnail()`
Other Functions
`get_the_category_data()`

### Example

    // check if the taxonomy has a Category Thumbnail assigned to it.
    if(has_category_thumbnail()) {
    	the_category_thumbnail();
    }

Note: To return the Category Thumbnail for use in your PHP code instead of displaying it, use: get_the_category_thumbnail()

### Example of functions.php

    if(function_exists('add_theme_support')) {
    	add_theme_support('category-thumbnails');
    }

### Source File

- `public_api.php`

### External Resources

- Neues aus der Agentur - Hauseigenes Plugin Category Thumbnails, by hovida design | Web- & Medienagentur Aachen

### Related

Category Thumbnails: has_category_thumbnail(), the_category_thumbnail(), get_the_category_thumbnail(), get_the_category_data()

Theme Support: add_theme_support(), remove_theme_support(), current_theme_supports()