Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress 3.8 custom post type icon

Following an update to Wordpress 3.8 my custom post type icons no longer work.

I've tried changing the css but if it worked before - why wouldn't it now?

CSS code is:

#adminmenu #menu-posts-cpt-stores:hover div.wp-menu-image, #adminmenu #menu-posts-cpt-stores.wp-has-current-submenu div.wp-menu-image {
background: transparent url('http://localhost:8888/dev.com/wp-content/themes/dev/images/icons/cpt-icon-16x16-hover.png') no-repeat scroll 7px 5px;
}
like image 908
jolen Avatar asked Jan 12 '23 16:01

jolen


2 Answers

WordPress now uses dashicons font for custom post types icon so now you don't need to use background property for showing our custom icons for CPT. You can use content property for that...

And Even you can add menu_icon arguments parameter and give class name to it.. for example:

'menu_icon'=>'dashicons-format-gallery',

like image 89
Raajen Avatar answered Jan 19 '23 00:01

Raajen


Here's a helpful article that describes how to use dashicons for custom post types: http://mannieschumpert.com/blog/using-wordpress-3-8-icons-custom-post-types-admin-menu/

like image 31
T-Dor Avatar answered Jan 18 '23 22:01

T-Dor