Question

I'm using add_filter('manage_posts_columns') in my plugin.php to add a column to the Edit Posts listing which is driven by edit.php. How can I attach a CSS style to the edit.php?

I want to be able to color the background of my column td.

Was it helpful?

Solution

Creating Admin Themes article in Codex shows you how to add css styles to admin pages

OTHER TIPS

As helpful as the codex page linked to is, it unfortunately doesn't cover hooking onto a set page or pages, rather the examples given generally hook onto the admin_head, which will load your stylesheet for every admin page (you probably don't want that).

For hooking onto the edit posts screen, the following hook will do that for you..

add_action( 'admin_print_styles-edit.php', 'your-function-callback' );

Replace your-function-callback with the name of the function you wish to call with the action.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top