AI Verified

Name

Add icons to the custom post types in the At a Glance Dashboard widget

About

This snippet adds custom icons to your custom post type counters in the At a Glance widgets on your WordPress Dashboard. I have a snippet in my Codevault on how to add CPTs to this widget too.

Language

PHP

Rating

Voted: 0 by 0 user(s)

How to Setup Snippet

• "Only run in administration area" in the snippet settings. • You will need to replace "custom-post-type-x" with the slug of your custom post type. • You can change the icon for each custom post type by changing the value after "content". This usually looks something like "\f123". You can find a full list of the available WordPress Dashicons here: https://developer.wordpress.org/resource/dashicons.

Codevault

Jamie

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Website/ Profile URL:

https://www.jdab.co.uk

History

Last modified:

15/11/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Add icons to the custom post types in the At a Glance Dashboard widget

 
                    
1// Add CSS to Admin head
2function cpticons_admin_head() {
3 ?>
4 <style type="text/css" media="screen">
5 #dashboard_right_now .custom_post_type_one-count:before {
6 content: "\f145";
7 }
8 #dashboard_right_now .custom_post_type_two-count:before {
9 content: "\f18f";
10 }
11 #dashboard_right_now .custom_post_type_three-count:before {
12 content: "\f122";
13 }
14 #dashboard_right_now .custom_post_type_four-count:before {
15 content: "\f307";
16 }
17 </style>
18 <?php
19}
20add_filter( 'admin_head', 'cpticons_admin_head' );

0

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

Unverified

0

WPengine remove Dashboard

Added: 1 year ago

Last Updated: 1 year ago

Remove WPengine Dashboard in WordPress AdminMenu

WordPress Admin

AI Verified

1

Disable plugin updates

Added: 1 year ago

Last Updated: 1 year ago

Some plugins just need to stay to that version. This snippet ensures that no automatic or manual update can be performed my anyone.

WordPress Admin

AI Verified

0

Filter Posts by Author dropdown

Added: 1 month ago

Last Updated: 1 month ago

Adds a dropdown to the posts screen to filter by author

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WordPress Admin

AI Verified

1

Add custom post types to the At a Glance Dashboard widget

Added: 8 months ago

Last Updated: 7 months ago

This snippet adds your custom post types to the "At a Glance" widget on your WordPress Dashboard. By default, only Posts and Pages display, but this snippet will allow you to pull in counters for all...

WordPress Admin

AI Verified

0

Add icons to the custom post types in the At a Glance Dashboard widget

Added: 8 months ago

Last Updated: 8 months ago

This snippet adds custom icons to your custom post type counters in the At a Glance widgets on your WordPress Dashboard. I have a snippet in my Codevault on how to add CPTs to this widget too.

Divi Builder

AI Verified

0

Enable the Dynamic Content option in the Divi Number Counter module

Added: 8 months ago

Last Updated: 8 months ago

This snippet enables Dynamic Content in the number field of Divi's Number Counter module. This would then allow you to control the content through a plugin such as ACF rather than the Divi Builder.