WordPress Custom Post Type Icons

wordpressLogoSoloThe best new feature in WordPress 3.0 has to be the ability to easily create custom post types. After you’ve created your post type you’ll see it show up in the admin menu with the same “pin” icon as the Posts menu has. This isn’t a huge deal, but it also isn’t difficult to change the icon as long as you have icons to use.

So, thanks to Yusuke Kamiyamane’s great Fugue icon set, I’ve created a sprited icon set made to match the WordPress admin icons. Just add the icon you want into your parent theme’s images folder and add a piece of code to the functions.php file and you’re done.

Update: Please make sure to read Jeff Rose’s comment below. Basically, in the video, I tell you that if you use underscores in your custom post type that WordPress strips these out. Well in 3.2, it no longer does. This means that the CSS will break, so you’ll just need to add the underscores back in from now on.


Download the WordPress Custom Post Type Icons

Functions.php code (WordPress 2.8 and above)

Functions.php code (Less than WordPress 2.8)

How to Use

If you want to check for a specific WordPress number, you can use “if (get_bloginfo(‘version’) >= 2.8)”

Follow Me On Twitter