Used a code to revoke some dashboard menus for my contributors but for some reason it’s revoked me access to the editor [closed]

Issue #1

This line of code define( 'DISALLOW_FILE_EDIT', true); does not go into functions.php. It should be removed from function.php and put in your config file, wp-config.php in the root of your WP install.

Here is more info on what DISALLOW_FILE_EDIT does.

Issue #2

You are removing the menu items for admins.

if(current_user_can( 'administrator' )){ 
    add_action( 'admin_menu','remove_menus' ); 
}

That is saying if the user is an admin remove your menus. Sounds like you want the opposite of that so you should be able to do something like this…

if(!current_user_can( 'administrator' )){ 
    add_action( 'admin_menu','remove_menus' ); 
}