in Tips, Tutorials, WordPress

How to Include a Retina Icon for Your Custom Post Type’s Menu Item

Here’s a quick little tip for you. Since WordPress 3.8, Dashicons has been included in the core and the menu item icons you see on the left in the dashboard are using the icon font instead of images. Why is this so cool? Well.. they’re retina ready, look awesome and scale infinitely!

So you’ve just created a new custom post type but want an awesome icon instead of the boring Posts pin icon? Well, it’s super easy.

When you’re creating the custom post type, make sure you have the menu_icon argument there and then just let it correspond to the Dashicon you want to use, like so:

https://gist.github.com/bryceadams/92ea4273a3ae09ab7392.js

Find a full list of the icons available and their CSS codes here.

For more on custom post types, visit the WordPress Codex.

Write a Comment

Comment