{"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\"><div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                   What Is WordPress Dashicons?\n                <\/p>\n            <\/div>\n            <p class=\"protip__content\">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><\/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>\n<\/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>\n<\/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            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Pro Tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\">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\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>\n<\/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>\n<\/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>\n<\/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\/w=1024,h=1024,fit=scale-down\" 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>\n<\/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>\n<\/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>\n<\/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>\n<\/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>\n<\/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-GB","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}]}}