So… you got your wordpress all pimped out with great plugins that are available from the wordpress db. One of the most useful plugins to have is the “Category Icons Plugin“. One (main) reason why you would want to have this plugin, is to show ‘graphically’ what category your post/article/note/blog (or whatever you wanna call it) belongs to.
One of the most overlooked feature of this Plugin, is the option of having multiple category icons. This how-to is geared towards that feature. So, what if you wanted to modify your Category Icons Plugin such that it showed Trails (i.e., breadcrumb)?
In this quick how-to, I will show you how you can modify/hack this plugin that will allow you to show trails.
First of all, lets briefly talk about:
Why you would want to have such a feature?
…because,
- (1) Simply having multiple category icons before the post title kinda dosen’t make sense… it’s just an indicator of (graphically) how many categories your post belongs to.
- (2) By having such bread crumb, you are making a reference of how the post originates.
To give an example, consider this particular post. At the top, you will see the title preceded by two category icons: how-to & wordpress. The image in between these two icons is the trail. With the help of such visual representation, it should become clear(er)* that this particular post is a how-to on/for the wordpress category. *(provided you are familiar with what category each icon indicates)
So, without further adieu, here’s how you go about achieving this:
- First, get an image the represents a trail (I am using an arrow).
- Next, open up category_icons.php file.
- Lastly, just save and upload the changed file and you should have a visual ‘trail’ (bread crumb) in the title of each post.
Find (it should be on line 211):
and replace it with the following block (make sure you change the code that is in bold):
$cat_icons .= $p['prefix'].$urlbegin.’<img src=”‘.trailingslashit(get_option(’siteurl’)).PLUGINDIR.’/category-icons/images/IMAGE-FILE-NAME.EXT” alt=”–>” title=”–>” /><img ‘;
}else{
$cat_icons .= $p['prefix'].$urlbegin.’<img ‘;
}
Results:

Before applying this hack

After you apply the hack
Of course, if you have more than two icons, this hack works just as well:
Hack at work, with more than two icons
Popularity: 1% [?]
Posted by
Under
Tags: 
No Comment Received
Leave A Reply