Display an image for each category associated with a post.
Notes:
This plugin provides the templates tag
c2c_the_category_image()
which basically reproduces and extends the functionality of WordPress's core function
the_category()
to add the ability to display a category image instead of the category name in the link to the category archive. With its $image_extensions argument defaulted to
""
, the plugin could be a drop-in replacement for
the_category()
. As is done in
the_category()
, the image or text for each category is also a link back to that category's archive.
Related info about the function:
- If $image_extensions is defined, but no image is found for the category, then nothing is displayed for that category.
- $image_extensions can be defined as a space separated list of image extensions. Files will be checked with the image extensions in the order those extensions were provided; default is 'png gif jpg'.
- The number of category links/images displayed can be limited via the $limit argument
- Category image tags are defined with class="catimage" for stylesheet manipulation.
- The result can be filtered via the filter named "c2c_the_category_image".
- Must be run inside "the loop".
c2c_get_category_image_list()
is another provided function, which is identical to
c2c_the_category_image()
except that it doesn't echo the result.
Links:
Plugin Homepage |
Plugin Directory Page |
Author Homepage