Change the custom post type icon for admin menu

Adding this snippet to the functions.php of your wordpress theme will create a custom post type products. On line 10 of this snippet we have menu_icon change the URL to the location of your 16px by 16px icon to display in the admin menu.

 

 

$args = array(
'label' => __('Products'),
'singular_label' => __('Product'),
'public' => true,
'show_ui' => true,
'capability_type' => 'page',
'hierarchical' => false,
'rewrite' => true,
'query_var' => 'products',
'menu_icon' => 'http://site.com/wp-content/themes/theme_name/i/icon_16x16.png',
'supports' => array('title','editor','comments','thumbnail')
);
register_post_type( 'product' , $args );

Leave a comment