Post Type Icons is a radically simple plugin that gives you 361 wonderful icons courtesy of Font Awesome. The icons are font-based, so they’re vector in nature and look amazing no matter your screen’s DPI. Now your custom post types can have custom icons that look just like the core icons in every state (previously, it was difficult to get the hover/active state working quite right). This will be in the WordPress Plugin Repository as soon as it’s approved!

Instructions for use

Install and activate the plugin as usual.

Go to Tools → Post Type Icons and figure out which icon you want to use. Get the name from underneath it.

In your theme or plugin, add the following bit of code (replacing “my-post-type” and “icon-name” as appropriate):

pti_set_post_type_icon( 'my-post-type', 'icon-name' );

For example:

pti_set_post_type_icon( 'event', 'calendar' );

Here’s what that looks like in a normal and active state:

(alternate) Instead of calling the function pti_set_post_type_icon() you can use the global variable $pti_icons. This way you don’t have to check if the function exists, or risk a Fatal error. Simply declare $pti_icons an associative array with key => value pairs of post type => icon name. Here’s our event/calendar example again using the global variable:

$GLOBALS['pti_icons'] = array( 'event' => 'calendar' );

I hope you enjoy this plugin! At some point (hopefully on the sooner side) I’ll make a GUI for this. I also set it up to potentially allow many icon sets, so I’ll add more to the collection. What would you like to see in it?