Contents
How do you use Dashicons?
Here are the steps:
- Go to the Dashicon Site.
- Select the Icon you want to use.
- Select the option to “Copy HTML”, and copy the code given for the Icon.
- Paste the code into the Text Editor or Text Widget of your choosing.
- Modify look of your Icon with custom CSS.
What are Dashicons in WordPress?
Dashicons are font icons that were introduced in WordPress 3.8. They are those awesome and cool icons you see when you log into your dashboard.
What is Dashicons CSS?
Dashicons are a library of icons that you can download as a webfont. They are served to your browser on the backend and the frontend. If you’re logged and ever notice the little icons next to “Posts” or “Pages” etc, these are all from the dashicons library.
How to use dashicons in the Admin menu?
If you want to use dashicons in the admin outside of the menu, there are two helper classes you can use. These are dashicons-before and dashicons, and they can be thought of as setting up dashicons (since you still need your icon’s class, too). Adding an icon to a header, with the dashicons-before class.
What are dashicons and how to use them in WordPress?
The more useful example of using WordPress Dashicons is for the navigation menu. To add icons in menus follow these steps: First, in the WordPress Dashboard go to Appearance/Menus. Then add HTML code of menu icon you got from WordPress.org to Navigation Label. As you can see adding an icon to a navigation menu is also simple.
How to use dashicons in a child theme?
Simple add the following to your theme’s functions.php to load Dashicons on the front-end (insert via a child theme if you are customizing an existing theme and not making your own). Now you can insert an icon via HTML as such:
How to use dashicons icon in portfolio post?
Simply visit the Dashicons landing page and click on any icon you would like to use and you’ll see the classname at the top next to the icon so you can copy and paste it. Below is a screenshot showing how the Dashicon icon would look like for the portfolio post type.