First of all download ‘Shortcodes in Menus’ plugin and install/activate it.
Then in theme’s function.php add following code.
add_shortcode( 'current-username' , 'ss_get_current_username' );
function ss_get_current_username(){
$user = wp_get_current_user();
return $user->display_name;
}
Now, in menu’s navigation lable write [current-username]
shortcode.
Same thing you can do for displaying avatar.
This way it will display logged in user name in menu item.
Related Posts:
- Why do Custom Nav Menus generate so many classes on list items? Can I manage this somehow?
- Custom search filter causes menu and query_posts problems
- Add separator to admin submenu
- How can I add (custom) modules to Appearance -> Menus?
- Use navigation path from menu for permalink
- How can I remove a menu item programmatically?
- Using string instead of object class instantiation on the walker argument breaks wp_nav_menu
- How can I show different menu for different pages?
- When add wordpress page in menu it converted in to custom link
- How can I add a sub menu to an existing navigation menu in WordPress?
- Adding different classes to anchor in navigation menu
- Main menu – get rid of titles?
- How to gain access to each menu item in wordpress?
- Second nav is merged with the first in mobile
- Import menu tree to custom menu from csv or xml, many nested menu points
- Create Dropdown menu Using wp_nav_menu() function
- Update Nav Menu Items Programmatically
- Programmatically create and place a nav menu in a theme location?
- Top Menu showing as Plain text before page load [closed]
- Add a class to the body tag when a menu is enabled
- how to change the output of wp_nav_menu using css classes
- Manage custom menu for an Editor?
- Add Button to Bottom of Mobile Menu
- how to remove the top navigation bar or header top on wordpress website?
- How do I check menu slug in WordPress?
- Add class active to static menu
- Show Home Link In wp_nav_menu but only on primary menu
- How to set my main menu items
- How to use buttons elements for tgetWordPress menu items?
- Sorting child item of navigation menu using code in wordpress
- I want to hide the navigation menu on a particular page
- automatically append menu parent as first item in submenu with nav_walker
- Difference between walker class and basic php
- Change hyphen/dash for vertical line in menu [closed]
- API for wp menu hacks
- wp_nav_menu action/filter help
- Trying to add a custom social icon to a Twenty Twenty-One child theme
- Adding toggle-able element after menu item
- WP admin style not refreshing
- Navigation menu not visible (contrast issue) on home page
- Tageting a specific menu link with nav_menu_css_class
- Full screen nav menu block with avada theme
- login logout menu changes in wordpress [closed]
- Style wp_link_pages as a select drop down list
- functions.php adding item to end of menu. I want to change position
- Plugins & Setting Menu Items Removed From Admin Panel
- Custom Menu Anchor Links Not Working
- WordPress Menu Exchange for Mobile Layout
- Responsive menu on genesis theme [closed]
- Question about Menus on WordPress
- Switching to child theme breaks menu names
- Main menu navigation links and new pages
- Bootstrap menu – make menu entries with submenu not clickable
- How to implement a secondary menu?
- Styling issue with custom menus and sub menus
- When I click a custom menu link, how do I make it update the URL in the browser to the external link?
- Disabling tooltip on menu items
- Divide Menu into Separate Menus and Display them Side by Side
- Duplicate menu items when auto generating menu from product categories
- Using menus to link to sections on the home page
- Hook or callback when wp_nav_menu() has completed
- Set one or more menus as a submenus of another menu
- How to show submenu of any page in main menu
- How to change the navigation menu
- Menu links URL with PHP GET method
- WordPress nav_menu items from another menu appearing
- Is it possible to remove the highlighted menu on Users and highlight a different menu?
- Adding widget to sidebar which contains current page’s submenu
- How To add this tag before drop-down ul. in wordpress
- Unable to get Navigation Menu to display in the desired location
- WordPress theme editor not showing
- How to switch menu location in this header.php?
- Why does WordPress convert absolute URLs to relative URLs for menu items?
- Extending Walker_Nav_Menu in wp_nav_menu List of Empty Items
- Jump to section on another page from menu item
- Users are required to login to my site. How define user.member boolean, its permissions, and conditionally display/handle behavior based on it
- How to Use Default Auto-Generated Menu?
- How to sort a sub-menu, generated with get_pages(), by the page order instead of alphabetically?
- Adding two same css class on menu item
- Two questions about CSSing inside the menus
- Different menu on different category need advice
- Add items to a menu
- Is there any way to recover deleted menu from database sql backup
- Use menu structure for permalinks
- Add tooltips with image in WordPress Menu?
- How to make a drop down menu with categories
- How to use my custom menus as seperate pages?
- Add class to current category menu item
- WordPress wp get nav menu items does not deliver external link
- wp_nav_menu changed to wp_page_menu
- How to load css file in my menu in wordpress
- Site pages show the page title under navigation bar
- Navigation menu, remove item from desktop
- Jquery dropdown menus working locally, but not in WordPress [duplicate]
- Wrapping my ‘s with
- Menu items do not “open” when mouse hover over them?
- Navigation menu displays permalinks
- Footer navigation menu
- Hiding Widget On Mobile Devices Removes Our Product Search Box On Mobiles
- Tried to hide navigation menu on one page ended up SCRAMBLING the navigation menu on another