Using Dashicons for Custom Post Types

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

  • Dan Gidman says:

    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 *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>