{"id":74047,"date":"2022-12-23T05:45:33","date_gmt":"2022-12-23T05:45:33","guid":{"rendered":"\/tutorials\/?p=74047"},"modified":"2024-03-26T15:00:06","modified_gmt":"2024-03-26T15:00:06","slug":"wordpress-dashicons","status":"publish","type":"post","link":"\/tutorials\/wordpress-dashicons","title":{"rendered":"How to use and display WordPress dashicons to make your theme stand out"},"content":{"rendered":"<p>One of the easiest ways to change your WordPress website&rsquo;s appearance is by changing its theme. However, searching for the right theme can take a long time, so changing it frequently to freshen up your site isn&rsquo;t the most efficient solution.<\/p><p>This is where WordPress Dashicons can come in handy.<\/p><p>Dashicons are the official WordPress font icons available from version 3.8. They&rsquo;re scalable, lightweight, and customizable using CSS. For this reason, you can use Dashicons without affecting your site&rsquo;s page load speed.<\/p><p>Keep reading as we will show you how to enable and use Dashicons&rsquo; font icon set in your WordPress website space.<\/p><p>\n\n\n\n\n\n\n\n<div class=\"protip\">\n                    <h2 class=\"featured-snippet title\">What Is WordPress Dashicons?<\/h2>\n                    <p>WordPress Dashicons is a set of font icons included in WordPress core since version 3.8. Over 300 font icons in the SVG format are ready to use without loading a third-party icon library. What&rsquo;s more, these font icons are scalable and lightweight &#8210; perfect for spicing up your website&rsquo;s design without hurting its page speed.<\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-use-and-display-dashicons-in-wordpress\">How to Use and Display Dashicons in WordPress<\/h2><p>The Dashicons library is available in your WordPress admin dashboard by default. However, you must enable Dashicons manually if you want to add icons to your theme.<\/p><p>In the following sections, we&rsquo;ll show you how to use the Dashicons library in WordPress.<\/p><h3 class=\"wp-block-heading\" id=\"h-enabling-dashicons-on-wordpress-site\">Enabling Dashicons on WordPress Site<\/h3><p>The first step of enabling Dashicons in WordPress is to edit your theme&rsquo;s <strong>functions.php<\/strong> file.<\/p><ol class=\"wp-block-list\">\n<li>Navigate to <strong>Appearance <\/strong>&rarr; <strong>Theme File Editor<\/strong> on your WordPress admin area.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-WordPress-theme-file-editor-from-the-admin-dashboard.png\"><img decoding=\"async\" width=\"1332\" height=\"592\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-WordPress-theme-file-editor-from-the-admin-dashboard.png\/public\" alt=\"Accessing WordPress theme file editor from the admin dashboard\" class=\"wp-image-74048\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-WordPress-theme-file-editor-from-the-admin-dashboard.png\/w=1332,fit=scale-down 1332w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-WordPress-theme-file-editor-from-the-admin-dashboard.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-WordPress-theme-file-editor-from-the-admin-dashboard.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-WordPress-theme-file-editor-from-the-admin-dashboard.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-WordPress-theme-file-editor-from-the-admin-dashboard.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1332px) 100vw, 1332px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"2\">\n<li>Open the <strong>functions.php<\/strong> file.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/Editing-the-Functions-file-using-the-Theme-File-Editor.png\"><img decoding=\"async\" width=\"1904\" height=\"882\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Editing-the-Functions-file-using-the-Theme-File-Editor.png\/public\" alt=\"Editing the Functions file using the Theme File Editor\" class=\"wp-image-74049\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Editing-the-Functions-file-using-the-Theme-File-Editor.png\/w=1904,fit=scale-down 1904w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Editing-the-Functions-file-using-the-Theme-File-Editor.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Editing-the-Functions-file-using-the-Theme-File-Editor.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Editing-the-Functions-file-using-the-Theme-File-Editor.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Editing-the-Functions-file-using-the-Theme-File-Editor.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1904px) 100vw, 1904px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"3\">\n<li>Add the following code snippet at the bottom of the <strong>Functions <\/strong>file:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' ); \nfunction load_dashicons_front_end() { \nwp_enqueue_style( 'dashicons' ); \n}<\/pre><ol class=\"wp-block-list\" start=\"4\">\n<li>Once done, select <strong>Update File<\/strong>. You can now use Dashicons on the front end of your WordPress site.<\/li>\n<\/ol><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p>Make sure to add the code to your <a href=\"\/tutorials\/how-to-create-wordpress-child-theme\" target=\"&rdquo;_blank&rdquo;\" rel=\"noopener\">child theme<\/a> to prevent future theme updates from reverting the changes.<\/p>\n                <\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-finding-dashicon-html-and-css-codes\">Finding Dashicon HTML and CSS Codes<\/h3><p>After enabling Dashicons for your site&rsquo;s front end, you can add icons to posts, pages, or parts of your theme.<\/p><p>Follow the steps below to add Dashicons to the menu items.<\/p><ol class=\"wp-block-list\">\n<li>Access the Dashicons icon library on the <a href=\"https:\/\/developer.wordpress.org\/resource\/dashicons\/\" target=\"_blank\" rel=\"noopener\">WordPress Developer Resources<\/a>. Click on your chosen icon, hit the <strong>Copy HTML<\/strong> link, and copy the Dashicons HTML code from the popup window.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/Retrieve-the-chosen-Dashicons-icon_s-HTML-code-from-the-official-WordPress-page.png\"><img decoding=\"async\" width=\"1244\" height=\"593\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Retrieve-the-chosen-Dashicons-icon_s-HTML-code-from-the-official-WordPress-page.png\/public\" alt=\"Retrieve the chosen Dashicons icon's HTML code from the official WordPress page\" class=\"wp-image-74050\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Retrieve-the-chosen-Dashicons-icon_s-HTML-code-from-the-official-WordPress-page.png\/w=1244,fit=scale-down 1244w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Retrieve-the-chosen-Dashicons-icon_s-HTML-code-from-the-official-WordPress-page.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Retrieve-the-chosen-Dashicons-icon_s-HTML-code-from-the-official-WordPress-page.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Retrieve-the-chosen-Dashicons-icon_s-HTML-code-from-the-official-WordPress-page.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Retrieve-the-chosen-Dashicons-icon_s-HTML-code-from-the-official-WordPress-page.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1244px) 100vw, 1244px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"2\">\n<li>Go to <strong>Appearance <\/strong>&rarr; <strong>Menus <\/strong>from your WordPress dashboard. Click on the menu item to expand the dropdown menu and paste the HTML code into the <strong>Navigation Label<\/strong> textbox before the text.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/Adding-a-Dashicons-icon-to-a-menu-item.png\"><img decoding=\"async\" width=\"1901\" height=\"908\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Adding-a-Dashicons-icon-to-a-menu-item.png\/public\" alt=\"Adding a Dashicons icon to a menu item\" class=\"wp-image-74051\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Adding-a-Dashicons-icon-to-a-menu-item.png\/w=1901,fit=scale-down 1901w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Adding-a-Dashicons-icon-to-a-menu-item.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Adding-a-Dashicons-icon-to-a-menu-item.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Adding-a-Dashicons-icon-to-a-menu-item.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Adding-a-Dashicons-icon-to-a-menu-item.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1901px) 100vw, 1901px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"3\">\n<li>Click <strong>Save Menu<\/strong>. Follow these steps for other menu items you want to modify.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-how-to-use-Dashicons-as-a-menu-icon.png\"><img decoding=\"async\" width=\"1024\" height=\"489\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-how-to-use-Dashicons-as-a-menu-icon.png\/public\" alt=\"An example of how to use Dashicons as a menu icon\" class=\"wp-image-74052\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-how-to-use-Dashicons-as-a-menu-icon.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-how-to-use-Dashicons-as-a-menu-icon.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-how-to-use-Dashicons-as-a-menu-icon.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-how-to-use-Dashicons-as-a-menu-icon.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>Besides <a href=\"\/tutorials\/wordpress-custom-css\">CSS code<\/a>, Dashicons also provide its font icons&rsquo; HTML code and Glyph character to streamline your website-building process. Use the filter function to find a specific font icon and copy the appropriate code anywhere within your WordPress website using a text editor.<\/p><p>For instance, copy the CSS code to add an icon font to the <strong>style.css<\/strong> file. You can use a custom CSS editor to modify your CSS file if you don&rsquo;t like what the Theme File Editor offers.<\/p><p>Here are some different ways to use Dashicons in WordPress:<\/p><ul class=\"wp-block-list\">\n<li>In post meta, such as in front of post titles.<\/li>\n\n\n\n<li>On the plugin settings.<\/li>\n\n\n\n<li>As part of posts and pages&rsquo; content.<\/li>\n\n\n\n<li>Inside or in front of a Gutenberg block.<\/li>\n<\/ul><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-wordpress-hosting\" href=\"\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"2048\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/public\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-creating-custom-icons-with-dashicons\">Creating Custom Icons With Dashicons<\/h3><p>The Dashicons project stopped accepting icon requests in <a href=\"https:\/\/make.wordpress.org\/design\/2020\/04\/20\/next-steps-for-dashicons\/\" target=\"_blank\" rel=\"noopener\">2020<\/a>. Therefore, the only way to create a custom icon is by modifying it using CSS code.<\/p><p>Here&rsquo;s an example of a code snippet to resize and change the color of a Dashicons. Place it in your <strong>style.css<\/strong> file and make sure the CSS selector targets your chosen element for this method to work.<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">.dashicons { \nfont-size: 50px; \nwidth: 50px; \nheight: 50px; \ncolor: blue;\n}<\/pre><h3 class=\"wp-block-heading\" id=\"h-adding-dashicons-to-wordpress-custom-post-types\">Adding Dashicons to WordPress Custom Post Types<\/h3><p><a href=\"\/tutorials\/wordpress-custom-post-types\">WordPress custom post types<\/a> appear inside the admin menu. Like other menu items, a custom post type has an icon next to it. The only problem is that WordPress assigns the same icon as <strong>Posts<\/strong> by default.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-a-custom-post-type-menu-with-a-default-icon.png\"><img decoding=\"async\" width=\"758\" height=\"423\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-a-custom-post-type-menu-with-a-default-icon.png\/public\" alt=\"An example of a custom post type menu with a default icon\" class=\"wp-image-74053\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-a-custom-post-type-menu-with-a-default-icon.png\/w=758,fit=scale-down 758w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-a-custom-post-type-menu-with-a-default-icon.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/An-example-of-a-custom-post-type-menu-with-a-default-icon.png\/w=150,fit=scale-down 150w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><\/a><\/figure><\/div><p>Adding Dashicons to your custom post types can solve this issue and make your admin dashboard more pleasing. If you develop custom plugins, you can assign different icons to help retain users&rsquo; attention and improve their readability.<\/p><p>You can either manually embed a menu icon into your custom post type menu or do so by using a plugin. For this tutorial, we will show you how to do it using the <a href=\"https:\/\/wordpress.org\/plugins\/custom-post-type-ui\/\" target=\"_blank\" rel=\"noopener\">Custom Post Type UI<\/a> plugin:<\/p><ol class=\"wp-block-list\">\n<li><a href=\"\/tutorials\/wordpress\/how-to-install-wordpress-plugins\">Install and activate the plugin<\/a>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/The-Custom-Post-Type-UI-listing-on-the-plugin-directory.png\"><img decoding=\"async\" width=\"560\" height=\"308\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/The-Custom-Post-Type-UI-listing-on-the-plugin-directory.png\/public\" alt=\"The Custom Post Type UI listing on the plugin directory\" class=\"wp-image-74054\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/The-Custom-Post-Type-UI-listing-on-the-plugin-directory.png\/w=560,fit=scale-down 560w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/The-Custom-Post-Type-UI-listing-on-the-plugin-directory.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/The-Custom-Post-Type-UI-listing-on-the-plugin-directory.png\/w=150,fit=scale-down 150w\" sizes=\"(max-width: 560px) 100vw, 560px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"2\">\n<li>Open the <strong>Edit Post Types <\/strong>tab and select the custom post type you want to modify from the dropdown menu. If you haven&rsquo;t created one yet, do so via the <strong>Add New Post Type <\/strong>tab.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/Choosing-a-custom-post-type-to-edit-via-the-CPT-UI-plugin.png\"><img decoding=\"async\" width=\"732\" height=\"179\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Choosing-a-custom-post-type-to-edit-via-the-CPT-UI-plugin.png\/public\" alt=\"Choosing a custom post type to edit via the CPT UI plugin\" class=\"wp-image-74055\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Choosing-a-custom-post-type-to-edit-via-the-CPT-UI-plugin.png\/w=732,fit=scale-down 732w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Choosing-a-custom-post-type-to-edit-via-the-CPT-UI-plugin.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Choosing-a-custom-post-type-to-edit-via-the-CPT-UI-plugin.png\/w=150,fit=scale-down 150w\" sizes=\"(max-width: 732px) 100vw, 732px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"3\">\n<li>Scroll down until you see the <strong>Menu Icon<\/strong> section. Click <strong>Choose dashicons<\/strong> and pick an icon that fits the custom post type. If you already have an image prepared, select <strong>Choose image icon<\/strong> to import it from your media library.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-the-Dashicons-library-from-the-CPT-UI-plugin.png\"><img decoding=\"async\" width=\"1071\" height=\"234\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-the-Dashicons-library-from-the-CPT-UI-plugin.png\/public\" alt=\"Accessing the Dashicons library from the CPT UI plugin\" class=\"wp-image-74056\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-the-Dashicons-library-from-the-CPT-UI-plugin.png\/w=1071,fit=scale-down 1071w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-the-Dashicons-library-from-the-CPT-UI-plugin.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-the-Dashicons-library-from-the-CPT-UI-plugin.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-the-Dashicons-library-from-the-CPT-UI-plugin.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/Accessing-the-Dashicons-library-from-the-CPT-UI-plugin.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1071px) 100vw, 1071px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"4\">\n<li>Click <strong>Save Post Type<\/strong> to save the changes. If the process is successful, you&rsquo;ll see a confirmation message, and the icon should appear next to the custom post type.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/12\/A-custom-post-type-with-a-custom-icon.png\"><img decoding=\"async\" width=\"1571\" height=\"504\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/A-custom-post-type-with-a-custom-icon.png\/public\" alt=\"A custom post type with a custom icon\" class=\"wp-image-74057\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/A-custom-post-type-with-a-custom-icon.png\/w=1571,fit=scale-down 1571w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/A-custom-post-type-with-a-custom-icon.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/A-custom-post-type-with-a-custom-icon.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/A-custom-post-type-with-a-custom-icon.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/12\/A-custom-post-type-with-a-custom-icon.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1571px) 100vw, 1571px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-removing-dashicons-in-wordpress\">Removing Dashicons in WordPress<\/h3><p>The size of Dashicons&rsquo; file is only around <strong>30 KB<\/strong>. While it&rsquo;s not big, disabling Dashicons&rsquo; auto-loading when you don&rsquo;t use it can improve your page load speed.<\/p><p>Add the following code snippet at the bottom of the <strong>functions.php<\/strong> file using the Theme File Editor. It will disable Dashicons from your website&rsquo;s front end for logged-in users.<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function disable_dashicon() {\n\tif (current_user_can( 'update_core' )) {\n\t    return;\n\t}\n\twp_deregister_style('dashicons');\n}\nadd_action( 'wp_enqueue_scripts', 'disable_dashicon' );<\/pre><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Dashicons is a useful feature that saves you the hassle of adding unnecessary images. The icons are lightweight, easy to embed, and have native WordPress support. While it&rsquo;s not for front-end use, you can fix it by enabling it manually with coding.<\/p><p>You have learned how to display and disable Dashicons in WordPress. We hope this article answers your questions about the popular WordPress icon library and ways to leverage it properly.<\/p><p>Should you have any more questions, don&rsquo;t hesitate to leave a comment below.<\/p><h2 class=\"wp-block-heading\" id=\"h-wordpress-dashicons-faqs\">WordPress Dashicons FAQs<\/h2><p>Take a look at the following frequently asked questions about WordPress Dashicons.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1682680967218\"><h3 class=\"schema-faq-question\">What Are Some of the Best Dashicons for WordPress?<\/h3> <p class=\"schema-faq-answer\">Some of the best Dashicons for WordPress include the<strong> admin-home<\/strong>, <strong>admin-tools<\/strong>, <strong>admin-users<\/strong>, <strong>admin-post<\/strong>, <strong>admin-media<\/strong>, <strong>welcome-widgets-menus<\/strong>, and <strong>format-image <\/strong>icons. These icons are commonly used for various functions in the WordPress dashboard and can help improve the user experience.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1682680977821\"><h3 class=\"schema-faq-question\">Do I Need Dashicons in WordPress?<\/h3> <p class=\"schema-faq-answer\">No, you do not need Dashicons in WordPress. Dashicons are great for improving the visual design and styling of your WordPress dashboard and do not affect the functionality of your site. However, removing Dashicons may affect the appearance of some plugins or themes that rely on them.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1682681004023\"><h3 class=\"schema-faq-question\">How Do I Add Custom Dashicons to WordPress?<\/h3> <p class=\"schema-faq-answer\">To add custom Dashicons to WordPress, use the <strong>font-face<\/strong> rule in your CSS and include the custom Dashicons font file. Then, use the content property to display the custom icon using a before or after <strong>pseudo-element<\/strong>.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1682681018799\"><h3 class=\"schema-faq-question\">What Is the Size of Dashicons in WordPress?<\/h3> <p class=\"schema-faq-answer\">The size of Dashicons in WordPress is <strong>20px by 20px<\/strong> by default. However, this can be adjusted using CSS to change the font-size property or by using a custom font file with different dimensions.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>One of the easiest ways to change your WordPress website&rsquo;s appearance is by changing its theme. However, searching for the [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/tutorials\/wordpress-dashicons\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":115,"featured_media":81826,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Use and Display WordPress Dashicons on the Website","rank_math_description":"WordPress Dashicons are font icons that can help a stale theme stand out. Learn how to add dashicons to your WordPress site in this article.","rank_math_focus_keyword":"wordpress dashicons","footnotes":""},"categories":[22643,22637],"tags":[],"class_list":["post-74047","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advanced","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/wordpress-dashicons","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/dashicons-wordpress","default":0},{"locale":"nl-NL","link":"https:\/\/www.hostinger.com\/nl\/tutorials\/wordpress-dashicons","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/wordpress-dashicons","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/wordpress-dashicons","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/wordpress-dashicons","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/dashicons-wordpress","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/dashicons-wordpress","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/dashicons-wordpress","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/wordpress-dashicons","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/wordpress-dashicons","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/wordpress-dashicons","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/wordpress-dashicons","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/74047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/comments?post=74047"}],"version-history":[{"count":9,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/74047\/revisions"}],"predecessor-version":[{"id":85092,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/74047\/revisions\/85092"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/media\/81826"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/media?parent=74047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/categories?post=74047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/tags?post=74047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}