DocumentationCategory Icons Filters

There are 2 filters :

1. category_icons

It can be used with the get_cat_icon tag. Examples of how to use it :

How to set a default icon

How to assign a specific icon for a post

How to modify the category icons through functions.php

2. category_icons_widget

It can be used with put_cat_icons tag. A how to needs to be written.

How toHow to set a default icon

Suppose you have categories that don’t have yet an icon assigned to. If you want to display a default icon instead of nothing (no icon), here is the code that you must paste in functions.php (in your theme) :

function bm_noicon($content) {
 if (empty($content)) {
   $content = '<img src="" alt="default icon" />';
 return $content;
add_filter('category_icons', 'bm_noicon');

Of course, you need to replace by your own icon/image URL.