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' );
}
Related Posts:
- How to give custom roles the capability to edit one Menu instead of every Menu
- Adding first / last CSS classes to menus
- Remove update nags for non-admins [duplicate]
- Mega Menu Walker
- start_lvl Ignored in Custom walker_nav_menu
- Allow Editors to edit pending posts but not draft ones
- wp_insert_user role not working
- Displaying Logged-In User Name in WordPress Menu
- Hide main div if wp_nav_menu is empty
- Menu Items Disappearing
- wp_delete_auto_drafts() deletes links in menus
- Edit a function to take different actions based on user role
- How to put 2 php codes in functions.php without site crashing
- Menu not updating for logged in users after redirect
- wp_get_nav_menu_items() with ACF
- How to switch between two primary menus (programatically0
- How to let mobile navigation menu close when link is clicked?
- Redirect User when they click Menu Option
- Get Child of Child Pages in custom Menu
- Primary navigation menu with timed items from custom post type
- PHP warning with code for nav menu walker [duplicate]
- Add element after navigation element title don’t works like I expect
- How to disable sub menu items from being created?
- String replace for Login/Logout concatenation problem in menu
- Bring Font Awesome icons inside menu A tags
- Difference between “Walker_Nav_menu” and “walker”
- Add parent menu item in sub-menu in custom nav_walker
- Add another role to a user when they click a button?
- Obtain wordpress user role
- How to properly create multiple conditions to redirect users roles to different pages
- How to create a sub-page of sub-page?
- Echo Option Value Based On WordPress User Role
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Vertical Menu for one page only
- Display specific main Sub Nav on Woocommerce product pages
- PHP drop down menu for my get_category child of
- Role exception for a settings sub menu
- Widget Logic – display on page and all child
- How limit the width of a fixed menu-bar on scroll?
- Pulling a variable into the wp_nav_menu function
- Beyond widget side menu editing, with the php page, custom template
- How to list categories by page id in wordpress
- Adding button to wordpress menu
- Allow BBPress participant role to trash topics
- Editing existing pre-created menus in PHP
- Two theme locations for two menus, but only one is showing up
- wp_nav_menu doesn’t work in a duplicate server
- Custom user roles doesn’t apply changes
- How I can add div to menu?
- wp_nav_menu prints children with parent name
- wp nav menu without label
- Contact form field in wordpress menu
- WP Admin Bar – Get current theme name as custom menu title
- Add extra markup to WP menus
- How to call a certain object/menubar in a PHP file
- Active class not working on custom menu link using add_menu_page
- Include administrator in author list
- Sidebar current menu item for parent
- Using ‘array’ method in wp_nav_menu causes it to disappear
- Remove all nav menu classes except those which begin with certain letters
- How to connect database table to each registered wordpress user.
- How to add a code for lastpostdate after/inside a specific menu link?
- Get author meta of all writers
- Add the “.current-menu-item” class to tag?
- How to get the count for each taxonomy term
- WP_Nav Highlight Parent Issue
- WordPress adding in site URL to header links
- How to change the menu color
- Can’t remove menu items added by plugin
- Custom Links in Walker Class
- Submenu opened problem
- if is_home(), change class of menu-item-225 of wp_nav_menu
- Nav Menu Display
- Adding a unique class to wp_nav_menu
- Change order that the menu is generated with wp_list_pages
- I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
- How do I modify the with wp_nav_menu()
- Switch-Case and user_role
- Make a permalink to the most recent blog post
- WordPress menu links with images & class selection
- Forbid certain users to access a specific page
- Open WordPress Page from selected option dropdown
- Inserting a shortcode into a genesis menu?
- Remove Unused Menu Locations
- How to lock users account until approvation
- Custom Navigation Bar JSON Syntax Error in JSON at Position 0
- How to add different menu items on different menus?
- How to create a User Role and give permission to only use Web Stories plugin?
- How to create custom user role without plugin?
- Custom nav with bootstrap dropdown
- Custom Admin Menu Report for Specific User ID
- Nav menù doesn’t display selected pages
- How to add custom user role into wordpress
- Show a text in menu
- WordPress Create New Role Just to Manage Users?
- make my custom theme support polylang plugin
- Can’t assign menu parent id or menu item breaks
- What is considered good practice for registering menu locations?
- Hide ID for WordPress User Role Subscriber
- How to Customize the Admin Sidebar Menu in WordPress Multisite Network by changing the backend code of the wp-admin code files?