Galen Gidman is a front-end and WordPress developer from Missouri. He runs BrandColors, ThemeBright, and he used to have a podcast. He infrequently writes about the web here.
Galen is current accepting work architecting maintainable, scalable front-end systems and WordPress-as-a-CMS builds.

Hire Galen

Using Dashicons for Custom Post Types

Posted on February 28, 2014 / 1 Comment

With it’s admin redesign in version 3.8, WordPress also launched a sporty new icon font that powers the menu icons. Before, menu icons were just images linked to using the menu_icon parameter when you registered the custom post type. You can still do this, but today I learned that you can also use a Dashicon in place of an image for your CTP menu icons.

It’s easy: when you register your CPT, enter the classname of any Dashicon in the menu_icon parameter. WordPress will use that a your CPT’s menu icon.

For example, If I’m working on a Slide CPT, I can use the Slide Dashicon like so:

1 Comment

Try or as well for some alternative icon font sets. I’m really enjoying due to their large sets of icons. However I don’t enjoy the css they output. They put more in it than they need.

pictos uses a data-icon attribute associated with a single character value. flaticon uses a classing structure. I prefer the data-icon approach as it creates a much cleaner set of css and html and you don’t have to worry about css cross contamination.

Leave a Reply

Your email address will not be published. Required fields are marked *