Favorite WordPress tip of the week:
This snippet will change the background colors of posts, pages, and custom post types in the administration post/page lists based on their status, i.e. draft, private, pending, etc.
<?php add_action('admin_footer','posts_status_color'); function posts_status_color(){ ?> <style> .status-draft { background: #ffffe0 !important ; } .status-future { background: #cf9 !important; } .status-publish { /* no background - keep alternating rows */ } .status-pending { background: rgba(170, 204, 255, 0.39) !important; } .status-private { background:#fc9; } </style> <?php }
Note: Draft color changed to a slightly lighter yellow than original.
Update on 5/18/2016: Changed pending color to lighter blue.
Is there a way to do this for the type of template a page is using?
If so, how do you target that in css?
Not sure what you mean by the type of template a page is using. Can you explain? Thanks.
I didn’t get it …where do i need to add this snippet…in theme functions.php??
You can add it to your theme’s functions.php file or to a custom plugin file.