How do I add css stuff to the admin backend to "display:none" on specific menu items? (I want to hide some menu items as the plugin Adminimize isn't doing what it should ).
Thanks heaps :)
How do I add css stuff to the admin backend to "display:none" on specific menu items? (I want to hide some menu items as the plugin Adminimize isn't doing what it should ).
Thanks heaps :)
I pop this in my functions.php to do all sorts of styling in my admin area
// THIS GIVES US SOME OPTIONS FOR STYLING THE ADMIN AREA
function custom_colors() {
echo '<style type="text/css">
#wphead{background:#592222}
#footer{background:#592222}
#footer-upgrade{background:#592222}
</style>';
}
add_action('admin_head', 'custom_colors');Thats cool.. but is there another function to add ANY css changes to the admin area, not just colors?
Logically, if you add in CSS changes in the section between the style calls in RVoodoo's example, yes.
yeah, you can add anything you want. My css is actually about 50 lines long, I just didn't want to post the whole thing.
I use firebug in FF, or developer toolbar in IE to find the class/id of whatever element I want to affect and then add that line to the css
the function is just named custom colors....but its for working over the css as a whole, not just colours
coooool :)
if I could just stretch the friendship that little bit more here and ask how i could apply those css changes to all users EXCEPT the admin... thanks.
Love Pete xxx
Checking first if the user level is not the admin one (i.e. 10):
function custom_colors() {
global $user_level;
if ($user_level != '10' ) {
echo '<style type="text/css">
/* Styles here! */
</style>';
}
}
add_action('admin_head', 'custom_colors');Thanks for that :)
This is an awesome piece of code. I wish there was a plugin that could insert a simple text field in there from the admin backend into where the /* Styles here! */ are
What add_action would I use to have this function apply css to the theme?
This?
function custom_colors() {
global $user_level;
if ($user_level != '10' ) {
echo '<style type="text/css">
/* Styles here! */
</style>';
}
}
add_action('wp_head', 'custom_colors');This is an awesome piece of code. I wish there was a plugin that could insert a simple text field in there from the admin backend into where the /* Styles here! */ are
It appears there is a plugin that does exactly this...
http://wordpress.org/extend/plugins/enhancing-css/
take a look at the pretty slick plugin Adminimize which handles the hiding of admin elements from different users.
This topic has been closed to new replies.