Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created January 13, 2012 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/1608960 to your computer and use it in GitHub Desktop.
Save jaredatch/1608960 to your computer and use it in GitHub Desktop.
Menu icons for custom post types
<?php
add_action( 'admin_head', 'ja_custom_cpt_icons' );
function ja_custom_cpt_icons() { ?>
<style type="text/css" media="screen">
#menu-posts-portfolio .wp-menu-image {
background: url(<?php echo plugin_dir_url( __FILE__ ); ?>images/portfolio-icon.png) no-repeat 6px 6px !important;
}
#menu-posts-portfolio:hover .wp-menu-image, #menu-posts-portfolio.wp-has-current-submenu .wp-menu-image {
background-position:6px -16px !important;
}
#icon-edit.icon32-posts-portfolio {background: url(<?php echo plugin_dir_url( __FILE__ ); ?>images/portfolio-32x32.png) no-repeat;}
</style>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment