Issue on adding Icons to Custom Post Type

Can you please take a look at following code and let me know why i am not able to add icons to custom post type?

add_action( 'admin_head', 'my_icons' );
function my_icons() {?
style type="text/css" media="screen"
 #menu-posts-product .wp-menu-image {
 background: url(?php bloginfo('url') ?/wp-content/themes/BootWp/img/contactLensemenu.png) no-repeat 6px !important;}
 .icon32-posts-product {
 background: url(?php bloginfo('url') ?/wp-content/themes/BootWp/img/contactLensepage.png) no-repeat !important;
    }
/style
?php } 

I have checked the root and image file existence, they are all correct but the code not working

Topic icon custom-taxonomy custom-post-types Wordpress

Category Web


This code works perfectly for me:

add_action( 'admin_head', 'my_icons' );

function my_icons() { ?>
 <style type="text/css" media="screen">
 #menu-posts-product .wp-menu-image, .icon32-posts-product {
     background: url(<?php echo get_template_directory_uri();  ?>/img/contactLensemenu.png) no-repeat center center!important;
 }
 #menu-posts-product .wp-menu-image { background-size:16px 16px!important; }
 .icon32-posts-product { background-size:32px 32px!important; }
 </style>
<?php } ?>

PHP part is the same of the yours, (except for get_template_directory_uri() that I use for convenience, because it is equivalent to your /wp-content/themes/BootWp`) I changed a bit the css, but I down know dimension of your image, the mine is 64X64px.

My WP is 3.6 and the product post type is registered by WooCommerce.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.