For the most part, I have no complaints about the WordPress admin styling. However, I have had complaints about some of the styling effects certain plugins have on admin styles. For example, one of the plugins I frequently work with adds a column to the edit.php pages (the list pages for your posts) to display some additional meta. The thing is that the info it displays isn’t extremely important and this new column makes the Title column very narrow (like 2-3 characters wide) and difficult to read. Since I prefer to read horizontally, I have to change some admin CSS to decrease the width of this new meta column. You can change the widths of any column or add/edit whatever admin css you’d like by inserting a snippet into the admin head. This snippet can either add the CSS directly to the head or pull an external stylesheet, whichever you prefer (for more than a little CSS, I’d suggest external stylesheet so you don’t clutter your functions.php). Either way you decide to go, here are the snippets for you to choose from:
//* Add CSS directly into the admin head add_action( 'admin_head', 'rv_custom_wp_admin_style_head' ); function rv_custom_wp_admin_style_head() { ?> <style> .mycustomcss1 { enter your css } .mycustomcss2 { enter more css } </style> <?php }
//* Load an external stylesheet (remember to enter the correct path to your stylesheet) add_action( 'admin_enqueue_scripts', 'rv_custom_wp_admin_style_enqueue' ); function rv_custom_wp_admin_style_enqueue() { wp_enqueue_style( 'custom_wp_admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' ); }
Matt says
thanks. good stuff
Michael says
//* Add CSS directly into the admin head
add_action( ‘admin_head’, ‘rv_custom_wp_admin_style_head’ );
function rv_custom_wp_admin_style_head() { ?>
.mycustomcss1 { enter your css }
.mycustomcss2 { enter more css }
****?> }****
***<?php }****
Chuck says
Thanks! Fixed it in the code snippet.
Karen Brigando says
You are the best, Ren! Thank you for all the great support you have given me. As a novice, I have had so many questions and you have provided me with quick responses that are spot on. I totally appreciate your willingness to help. My site wouldn’t be nearly as good without you!.Thank you so much.
Ren says
Hey Karen. Thanks for the kind feedback! I’m glad to help. 😀