tags:

views:

57

answers:

1

I am trying to show a custom css depending on user permissions with a function like :

 <?php
if ( !current_user_can( 'install_themes' ) ) { ?>
<link media="all" type="text/css" href="<?php bloginfo( 'template_directory' ); ?>/library/styles/customAdmin.css" rel="stylesheet">
<?php }

Perhaps I am being dense about this but I want to do the reverse and show specific CSS if a user can not, in this case, install_themes. I am doing it this way because the css hides parts of the admin area that I do not want hidden globally. I could probably do this with liberal use of !important in my style sheetsbut I was hoping there was an easier way to write this in the function.

Or is there a way to write

<?php if ( current_user_can('level_7') ) : ?>

with something like if < level_7 ?

+1  A: 

Give this a go: http://wordpress.org/extend/plugins/adminimize/

And if you don't want to use that than at least take a look at the source code to see how it's done.

hsatterwhite