Find out how to Upload or Trade WordPress Admin Icons (2 Simple Strategies)

by | Nov 4, 2024 | Etcetera | 0 comments

Personalizing your WordPress dashboard can support the individual revel in. One easy means to try this is by means of together with or changing admin icons.

Custom designed icons can support your workflow and make it more uncomplicated for brand new shoppers to navigate the admin area of your web site. Plus, a custom designed dashboard is additional enjoyable to use.

In this article, we will show you how one can add or change WordPress admin icons. We will data you all through the process step by step. By way of the highest, your WordPress dashboard will look fresh and unique.

Changing menu icons in WordPress admin area

What Are Admin Icons in WordPress?

Admin icons are the tiny pictures you understand throughout the navigation panel of the WordPress admin area. They appear next to each and every menu products.

Menu icons in WordPress admin area

The ones pictures use Dashicons, an icon font made for WordPress. It was once first offered in 2013 and has no longer changed since then.

It is advisable want to give your WordPress admin area a slight makeover by means of changing the ones icons. You’ll transfer out provide icons with something you like upper or even replace them with your own custom icons.

In case you’re creating a website online for consumers who don’t appear to concentrate on WordPress, the use of custom icons can lend a hand them navigate the admin dashboard additional merely.

Now, let’s see the way you’ll be capable to merely change admin icons. We will show you two tactics to check out this, and also you’ll be ready to make a choice the one that works best for you:

Manner 1: Industry Admin Icons in WordPress Admin Using a Plugin

For the program, we will be the use of the Admin Menu Editor plugin. For the reason that identify suggests, it signifies that you’ll customize WordPress admin menus merely.

First, you wish to have to place in and switch at the Admin Menu Editor plugin. For added details, see our educational on methods to set up a WordPress plugin.

After you have activated the plugin, cross to the Settings » Menu Editor internet web page. Proper right here, you’ll see your WordPress admin menu inside a neat particular person interface (UI) where you’ll be capable to customize it.

The UI has a toolbar on the most productive, which helps you to add or delete menu items, add separators, copy and paste items, and further.

Menu editor

Underneath that, you’ll be capable to click on on on a menu products to extend and read about its settings. Proper right here, we’ve were given expanded the Posts menu products.

See also  What’s “Quiet Quitting”? And Why It is Trending on Social Media

While you building up any menu products, you’ll see additional possible choices. If it is a father or mom menu, you’ll moreover see any child menu items in the correct column.

With the intention to upload, replace, or delete a menu icon, click on on on the ‘Show complicated possible choices’ link at the bottom.

Choose menu icon

Now, click on on on the button next to the ‘Icon URL’ field.

This may occasionally an increasing number of disclose a popup where you’ll be capable to see all the available Dashicons. On the other hand, you’ll be capable to click on on on the ‘Media Library’ button so as to add your own image icon.

Select font icon

If you want to upload your own image icon, we recommend the use of a 32&instances;32 image, preferably in transparent PNG format.

After opting on your icon, click on on on the ‘Save Changes’ button to store your settings.

You’ll now see your custom menu icon used throughout the admin menu.

Custom icon using the plugin method

Manner 2: Manually Industry Admin Menu Icons Using a Code Snippet

This next method requires you with the intention to upload some custom code to switch icons.

In case you occur to haven’t finished it forward of, we recommend taking a quick check out our educational on including tradition code in WordPress.

The perfect and maximum protected means with the intention to upload custom code in WordPress is the use of WPCode. It’s the most productive WordPress code snippets plugin. It signifies that you’ll safely add custom code, CSS, and HTML for your WordPress web site without by accident breaking the remaining.

Remember: The plugin moreover has a unfastened type known as WPCode Lite, which is in a position to get the method finished. Then again, the pro type will provide you with further choices which may be helpful.

Example 1. Converting an Icon Using the Default Dashicons

For this situation, we will use the default Dashicons to switch an icon from the existing icon set.

It’s important to note that WordPress already such a lot Dashicons, which are extraordinarily optimized for potency. So, the use of them isn’t going to have an effect on web page load pace.

That said, forward of you run the code, you wish to have to note down the following:

  1. The URL for the menu products you want to switch
  2. The icon identify you want to use

First, you wish to have to look out the internet web page URL for the menu products you want to customize. For instance, let’s say you want to switch the icon for the ‘Posts’ menu.

Switch your mouse over to the Posts menu, and also you’ll see the URL it links to in your browser’s status bar at the bottom of the internet web page. You merely need without equal part of the URL, which in this case may also be edit.php.

Find page URL

Next, cross to the Dashicons website online and click on on on the icon you want to use.

See also  Get the Unique FREE Cyber Monday Theme Builder Pack #3

Clicking on any icon will show its identify and slug on the most productive. At this degree, you wish to have to copy the slug because you’ll need it in the next step.

Select icon dashicons

On every occasion you’ve finished that, cross to the Code Snippets » + Add Snippet internet web page and hover your mouse over the ‘Add Your Custom designed Code (New Snippet)’ box.

Then, simply click on on on the ‘+ Add Custom designed Snippet’ button that appears.

Add new custom code snippet

On the next show, provide a reputation for your snippet and make a choice PHP Snippet underneath the Code Kind risk.

After that, you’ll be capable to copy and paste the following code into the code editor box:

function change_post_menu_icon() {
    international $menu;
    
    // Loop all through the menu items
    foreach ($menu as $key => $menu_item) {
        // To search out the "Posts" menu products (default URL is 'edit.php')
        if (isset($menu_item[2]) && $menu_item[2] == 'edit.php') {
            // Industry the icon to any other Dashicon class
            $menu[$key][6] = 'dashicons-format-aside'; // Industry this for your hottest Dashicon slug
        }
    }
}
add_action('admin_menu', 'change_post_menu_icon');

Don’t omit to switch the dashicons-format-aside to the slug you copied earlier.

Your code will seem like this throughout the editor:

Add menu icon code

Next, you wish to have to tell WordPress where to run this code.

Admin menu icons appear throughout the WordPress admin area. On the similar internet web page, scroll to the Insertion phase and make a choice ‘Admin Only’ underneath the Location risk.

Load code location

In any case, switch your snippet to Full of life and click on at the ‘Save Snippet’ button to save lots of plenty of your changes.

WordPress will now get began the use of the icon you made a decision on for the Posts internet web page.

Custom icon code method

Example 2. Use Font Awesome Icon for a Menu Products in The WordPress Admin Area

The default Dashicon library has a limited set of icons. The good news is that you just’ll be capable to use a font and icon library like Font Awesome, which has a a long way higher set of icons.

Then again, this means you’ll need to load Font Awesome, which might perhaps slow down your WordPress admin area rather (only a few milliseconds).

Faster than you add any code, first you wish to have to look out the icon you want to use. Cross to the Font Awesome web site and switch to the Loose Library.

Font Awesome website

You’ll see all the icons available without spending a dime.

Click on on on the icon you want to use, and it’ll open in a popup. From proper right here, you wish to have to copy the icon’s Unicode value.

Find unicode for the icon you want to use

After that, cross to the Code Snippets » + Add Snippet internet web page in your WordPress dashboard.

Cross ahead and click on on on the ‘+ Add Custom designed Snippet’ button all the way through the ‘Add Your Custom designed Code (New Snippet)’ box.

Add new custom code snippet

On the next show, provide a reputation for your snippet and make a choice PHP Snippet for the reason that Code Kind risk.

See also  What Are Remarketing Lists for Seek Commercials (RLSA)?

After that, you’ll be capable to copy and paste the following code into the code editor box:

// Enqueue Font Awesome throughout the admin area
function enqueue_font_awesome() {
    wp_enqueue_style('font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');
}
add_action('admin_enqueue_scripts', 'enqueue_font_awesome');

// Add custom class to the Posts menu products
function add_custom_post_menu_class() {
    international $menu;

    foreach ($menu as $key => $menu_item) {
        if (isset($menu_item[2]) && $menu_item[2] == 'edit.php') {
            $menu[$key][4] .= ' custom-post-menu-class';
        }
    }
}
add_action('admin_menu', 'add_custom_post_menu_class');

// Add custom CSS to switch the icon to a Font Awesome icon
function custom_admin_menu_icon() {
    echo '
        .custom-post-menu-class .wp-menu-image:forward of {
            font-family: "Font Awesome 5 Loose" !important;
            content material subject matter: "f015"; /* Unicode for the Font Awesome icon */
            font-weight: 900; /* Sought after for cast icons */
        }
    ';
}
add_action('admin_head', 'custom_admin_menu_icon');

Don’t omit to switch f015 with the Unicode value you copied earlier.

Your code will seem like this throughout the editor:

Adding font awesome code for a menu item

Next, you wish to have to tell WordPress where to run this code.

Admin menu icons appear throughout the WordPress admin area, so that you’ll be capable to scroll to the Insertion phase and make a choice ‘Admin Only’ for the reason that Location risk.

Load code location

In any case, switch your snippet to Full of life and click on on on the ‘Save Snippet’ button to save lots of plenty of your changes.

WordPress will now get began the use of the icon you made a decision on for the Posts internet web page.

Custom menu icon using Font Awesome

Bonus: Add Icons for Custom designed Put up Sorts in WordPress

Custom designed post sorts help you create unique varieties of content material subject matter for your WordPress web site. The ones don’t appear to be default posts or pages alternatively something totally distinctive for your web site.

In case you’re the usage of a tradition put up sort in your WordPress web site, you might want to change its icon so as to merely identify it.

Changing menu icon for a custom post type in WordPress

If that’s the case, check out our detailed tutorial on the matter, which presentations a few tactics to alternate or upload icons on your tradition put up varieties.

We hope this article helped you convert or add admin icons in WordPress. You might also want to check out methods to white-label the WordPress admin dashboard or view the ones a professional recommendations on customizing the WordPress admin space for upper workflows.

In case you occur to preferred this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You’ll moreover to seek out us on Twitter and Fb.

The post Find out how to Upload or Trade WordPress Admin Icons (2 Simple Strategies) first seemed on WPBeginner.

WordPress Maintenance

[ continue ]

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!