Change custom post type icon for new and edit post pages

Adding this snippet to the functions.php of your wordpress theme will change the default icon on the post edit and new post pages. Don’t forget to change the URL on line 9 to the location of your 24px by 24px icon.



add_action( 'admin_head-post.php', 'post_type_icon');
add_action( 'admin_head-post-new.php', 'post_type_icon');
function post_type_icon() {
global $post_type;
<?php if($post_type == 'products'){ ?>
#icon-edit {
background: url('<?php echo '';?>') no-repeat; }
<?php } ?>

Leave a comment