Dashicons in dashboard

In the past, I’ve added this snippet to extras.php to define icons for the dashboard:

function custom_icons() {
   echo '<style type="text/css">#adminmenu #menu-posts-product div.wp-menu-image:before {content: "\f307";}</style>';
}
add_action('admin_head', 'custom_icons');

But in my newest Sage install, this isn’t working at all. Am I missing something? Thanks.

You really should enable debugging when you’re developing (or if you have it enabled, share the error messages!).

The reason why it’s not working is you’re not accounting for Sage’s namespacing. Read through Kalen’s article on the matter: https://roots.io/upping-php-requirements-in-your-wordpress-themes-and-plugins/ and you should be able to fix it yourself.

1 Like

Thanks, @Foxaii! Missed the namespacing update info.