Add CSS to custom post type admin pages
-
I’m working on a plugin that creates a custom post type and I am trying to customize that post type a bit.
I have the custom post type working fine using
register_post_type
, and I have added a custom icon usingmenu_icon
. That is the smaller icon in the menu.But I would like to customize the larger icon on the Edit and Add New admin page for that custom post type as well.
I have some code that works to do this across all of the
edit.php
pages:function myposttype_admin_css() { echo "<link type='text/css' rel='stylesheet' href='"; echo plugins_url('myposttypeadmin.css', __FILE__); echo "' />"; } add_action( "admin_print_styles-edit.php", 'myposttype_admin_css' )
But I’d like it to be more specific and only add that stylesheet to the custom post type pages.
I tried this action with no success:
add_action( "admin_print_styles-edit.php?post_type=myposttype", 'myposttype_admin_css' )
Anyone have any ideas on how I can pull this off?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Add CSS to custom post type admin pages’ is closed to new replies.