In this post, I will share How to Add BGs Color to Admin Table by Post Status in WordPress with an example.
This is very simple WordPress snippet to add custom background colors to the admin post listing tables by post status like draft, pending, publish, future and private posts.
Add the following snippet at the end of your functions.php file from your current activated theme folder.
1 2 3 4 5 6 7 8 9 10 11 12 | add_action('admin_footer','posts_status_color'); function posts_status_color(){ ?> <style> .status-draft{background: #FCE3F2 !important;} .status-pending{background: #87C5D6 !important;} .status-publish{/* no background keep wp alternating colors */} .status-future{background: #C6EBF5 !important;} .status-private{background:#F2D46F;} </style> <?php } |
After adding the above code inside your functions.php file, your admin post listing page will look like below screenshot.
I hope you found this tutorial helpful! Please do like and share this tutorial with friends and don’t forget to subscribe to get latest WordPress tips directly in your mailbox.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: woocommerce plugin for wordpress tutorial, wordpress snippet, wordpress snippets, wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials, wordpress tutorials for beginners, wp snippets