Hi @hotice83
Setting “display: none” for #adminmenumain will fully hide entire admin menu (entire left menu column in wp-admin) area. If this is exactly what you want to do then let’s take a step back.
1. remove all the code/undo everything that was discussed here so far
2. create empty file with a .php extension (e.g. “admin-userrole-css.php” )
3. copy and paste this code into it (using plain text editor)
<?php
function wpmu_admin_side_role_based_style() {
if ( current_user_can( 'shop_manager' ) ) {
?>
<style>
#adminmenumain { display: none !important; }
#wpcontent { margin-left: 0px !important; }
</style>
<?php
}
}
add_action('admin_footer', 'wpmu_admin_side_role_based_style');
4. save the file
5. use your favorite FTP client (like FileZilla or similar) or cPanel’s “File Manager” and upload that file to the “/wp-content/mu-plugins” folder of your site’s WP installation
It should work out of the box (I tested it).
Note please: I understand that this is slightly different and includes PHP but it’s very simple code and much simple solution than using multiple plugins and codes.
Kind regards,
Adam