Create a menu for each type of user in Dashboard >> Appearence >> Menus >> create a new menu (eg http://example.com/wp-admin/nav-menus.php?action=edit&menu=0)
Then add a function to your theme’s functions.php to switch the menus. Something like as follows:
add_filter('wp_nav_menu_args', 'wp_nav_menu_args_filter');
function wp_nav_menu_args_filter($args = array()) {
if (is_user_logged_in) {
// Menu for Logged In Users
$args['menu'] = "name-of-user-menu";
return $args;
} else {
// Default Menu
return $args;
}
}
Related Posts:
- Check if add_menu_page exists or not
- Is there a way (plugin?) to restrict a user to being able to edit just one page?
- Add custom menu item type
- Where the Nickname is being used in WordPress
- Keep one user logged for a year?
- User-Specific Timezones? Hack? Plugin?
- Custom wp_nav_menu output (displaying all child elements of top menu element in current branch)
- Removing user contact methods works from functions.php but not from a plugin
- How to make a plugin auto-add item to nav menu
- Removing WordPress Plugin Menu Item for a specific user
- How to expire all wordpress user passwords instantly?
- How to show popup to a group of users?
- Mass Import Users without sending new user notification
- How use %like% in sql statement wordpress
- update_user_meta add value on the top on existing value
- Reset WordPress website
- How to transfer all user data between wordpress installations?
- Getting user roles in plugin files
- Auto delete WordPress users according to time
- Set the active Navigation Menu from a plugin
- How to associate more than one user to a post?
- Menus, but not by theme location
- How to create user groups and allow custom posts and plugin modify/access to specific group?
- WordPress Central User Database
- How to read individual user’s directory and display content to that specific user?
- Creating a nav menu
- wp_set_auth_cookie causes 403 error in the wooCommerce checkout
- Easiest way to add dropdown to a page
- Merging Two menus in the backend into one menu
- How can I copy all users to newly created site on a multisite network in WordPress?
- Enable users to change change and add taxonomies of posts
- html generated by theme exist but doesnt appear in browser
- Center and hide overflow of WP toolbar custom links
- How to remove admin main menu name repetition
- Custom Permalink Plugin and Current Page/Ancestor in Menus
- wp-custom-menu filter removes the current_page_item class
- add_action does not call the function
- Redirect to another page using contact form 7? [closed]
- edit_user_profile and show_user_profile are not firing inside a class
- Multisite – maximum number of users with specific role
- How to have sample page for each new register users in a membership website
- How to get menu location in wp_update_nav_menu hook
- Specific way to allow WordPress users to view their current password? And edit it?
- PHP script from functions php is loaded via admin-ajax to div…and the result is 0, not the desired content
- Progmatically adding menu links to the default (Top) or Footer menu
- How to pass a query string to another page on the same site?
- Need to revert to an older version of wordpress
- WordPress Custom Menu Admin helper plugin
- How can I add a fixed vertical menu to my site? [closed]
- 2 wordpress site same database
- Remove specific administrator’s capability
- Personalized Author Area
- How to auto strip hyperlinks & images in wordpress post
- Dropdown menu on click change
- Creating teams of users in WordPress
- WordPress plugin for Limited days user
- How do i specify a url to which to redirect the user after he logs out from facebook?
- I cannot include a file in my plugin settings page
- Can’t save changes or modify settings in Dashboard but Pages and Posts are fine
- Disable Author Archive just for certain roles in bulk
- How to implement data residency in my WordPress site
- how to create user profile pages and display them based on users roles
- Clean old users
- WordPress site hamburger menu toggle not working
- User updating their profile wipes my custom fields
- Scroll to ID broken in main menu
- Comment restrictions Wodpress
- jquery plugin won’t fire when hamburger class element clicked
- Simulate Update User button click
- Update User Meta Via Ajax
- User Following System
- How to see in Edit Comments if comment is from User and her Roles
- Sub Categories in drop down menu
- How can I save cookies to members
- Every time I use wp_get_current_user() my plugin breaks
- Admin page and admin menu. Permissions plugin
- Users Ultra: Hide asterisk for required registration fields?
- WordPress menu and plugin installation problem
- Power Menus plugin destroys menu after adding new item
- Defined user role to access plugin’s pages
- add_media_page function not creating submenu
- How can I pass value to function in add_menu_page?
- Multiple Plugins Interacting with Menu
- How to add plugin activity in the menus?
- How to set different users for different pages?
- Redirect url in plugin to somewhere else?
- Want to add post to user dashboard
- How can I add different menus (different style menu) on each page?
- Make a Custom template for a specific category in wordpress
- How can I create a navigation menu in the sidebar that can also act like a slider?
- How to make wordpress backend mobile optimized.?
- Plugin: Custom menu item problem
- Is it possible to know which menus are owned by a plugin?
- How to give access to the particular page in wordpress for specific username/email NOT roles [closed]
- My wp_update_nav_menu action is firing twice
- Share or sync user table data with another user table
- How to check if the Menubar contains no items?
- Adding fontAwesome to Primary Menu returns after saving the menu
- Prevent primary navigational menu from expanding during page load (WordPress / Astra Theme)
- Issues with creating user profile for a subscriber, but with different profile page and functionalities