Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Change “login/register” to “useraccount” when a user has logged in

I did a similar thing in many of my projects, here’s how I did it:

<div class="user-panel">
    <ul>
        <?php
        if (is_user_logged_in() ) {
            // When the user is Logged-in
            $current_user= wp_get_current_user();
            echo '<li>'. __( 'Welcome, ', 'text-domain' ) .'<strong>'. $current_user->user_nicename .'</strong></li>';
            echo '<li><a href="'. wp_logout_url( home_url() ) .'" title="Log out">'. __( 'Log out', 'text-domain' ) .'</a></li>';
        }
        else
        {
            // When user is logged-out
            echo '<li><a href="'. wp_registration_url() .'" title="Register a New Account">'. __( 'Register', 'text-domain' ) .'</a></li>';
            echo '<li><a href="'. wp_login_url() .'" title="Login to the site">'. __( 'Login', 'text-domain' ) .'</a></li>';
        } ?>
    </ul>
</div>
<!-- /.user-panel -->

It’s not a matter of CSS, it’s a matter of Templating. After this, do the CSS to make it look better. šŸ™‚

Related Posts:

  1. Add “Logout” link to navigation menu
  2. Unregister Nav Menu from Child-Theme
  3. Add a logout menu link [duplicate]
  4. Add log in link to menu in Twenty Twelve
  5. add the user name to menu when user is logged in [closed]
  6. wp_nav_menu log in/out link?
  7. Making WordPress’ page and menus visible only for logged in users, checking session variables
  8. Show menu item only if user is logged In (not word press login)
  9. I need help adding a second custom menu item to the WooCommerce account area menu
  10. Use another menu when logged in
  11. unable to add custom page/tab to my account woocommerce
  12. How to Show Different Menus to Logged in Users in WordPress [duplicate]
  13. login logout menu changes in wordpress [closed]
  14. WordPress Login/Logout Single Menu Only
  15. How to add Loginout to Sub-menu
  16. How to make Logout Link consistently appear on all web pages?
  17. Build a one-page navigation within a non-one-page ttheme…
  18. Display a portion/ branch of the menu tree using wp_nav_menu()
  19. Check if wp-login is current page
  20. Programmatically add a Navigation menu and menu items
  21. Any docs for wp_nav_menu’s “items_wrap” argument?
  22. Customizing Only a Specific Menu using the “wp_nav_menu_items” Hook?
  23. Changing the Order of Admin Menu Sections?
  24. How make top level menu item not have link, but have sub-menus that are linked?
  25. Add ‘has_children’ class to parent li when modifying Walker_Nav_Menu
  26. Get WP Navigation Menu from REST API V2
  27. How to Hard Code Custom menu items
  28. How to add a Custom Link to a Menu with a URL that is relative to the blog URL
  29. How do I remove UL on wp_nav_menu?
  30. Retrieving a list of menu items in an array
  31. WordPress default menu in database
  32. Adding an Arbitrary Link to the Admin Menu?
  33. Dynamically exclude menu items from wp_nav_menu
  34. Separate registration and login for different roles
  35. Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()
  36. Split up wp_nav_menu with custom walker
  37. SSO / authentication integration with external ‘directory service’
  38. Removing container from wp_nav_menu not working
  39. Custom Nav walker display current menu item children, or siblings on no children
  40. wp_nav_menu: show menu only if one exists, otherwise show nothing
  41. Is there an easy way to replace a custom menu link with a page or post?
  42. Convert output of nav_menu items into a tree-like multidimensional array
  43. Get page IDs from nav items
  44. How to prefill WordPress registration with social details
  45. Add a custom walker to a menu created in a widget
  46. Using a menu walker add a custom item at the end of the menu’s items
  47. Add settings to menu items in the Customizer
  48. wp_get_nav_menu_items() not working with slug
  49. How to get current-menu-item title as variable?
  50. Error “Trying to get property of non-object” with Custom Walker for wp_nav_menu
  51. Add Class to Specific Link in Custom Menu
  52. Remove a menu item in menu
  53. Generate a Menu that Displays Child Pages using wp_list_pages() with the New Menu Functionality in WordPress 3.0?
  54. How do I get the name of a menu in WordPress?
  55. How to Add to Each Menu Link with link text to data-attr?
  56. How to manually specify the current active page with wp_nav_menu()
  57. How to count nav menu items?
  58. How Does The Walker Class Work?
  59. How to change “You must be logged in to post a comment.”
  60. Add Javascript to WordPress Menu
  61. Add custom menu item using wp_nav_menu_items filter
  62. Filter wp_nav_menu()
  63. How to modify navigation menu of the “My Account” page in WooCommerce
  64. remove “edit your profile” from admin menu bar
  65. WordPress Settings API, Implementing Tabs On Custom Menu Page
  66. Adding line breaks to nav menu items
  67. Adding category ID or slug to WP Nav Menu
  68. add custom class to wp_nav_menu using filter hook nav_menu_css_class
  69. Custom ID for certain menu item?
  70. Does Extending Multiple Nav_Menu_Walkers Allow Nested Menus?
  71. Check if page is in a certain menu
  72. how to create a menu with all sub categories?
  73. Making breadcrumb with wp_nav_menu
  74. Does WP REST API have a built in route for calling menu?
  75. WordPress auto login after registration not working
  76. How to avoid wp_nav_menu() ID conflict?
  77. Add data-icon input to WordPress custom menu links
  78. Registering menu with ‘Automatically add new top-level pages to this menu’ selected
  79. Why do Custom Nav Menus generate so many classes on list items? Can I manage this somehow?
  80. wp_nav_menu remove class and id from li
  81. Custom search filter causes menu and query_posts problems
  82. How does a minimal menu walker look like?
  83. Add separator to admin submenu
  84. fall back for main menu?
  85. On which hook should I be calling register_nav_menu(s)?
  86. WordPress Shortcode in Menu Item Title
  87. register_nav_menus() won’t register menus
  88. Calling the Menu Title within wp_nav_menu array function
  89. How can I create an auto-populated menu that is automatically assigned to a location?
  90. Woocommerce registration page [closed]
  91. Display only page specific sub menu items using Custom Walker
  92. How do I add a search box to the nav menu?
  93. How to get IDs for objects in menu branch?
  94. New post notification in wp_nav_menu
  95. Custom Post Types posts as submenus in Nav Menu
  96. Link to Author archive from Navigation Menus in dashboard?
  97. How to stop mobile theme inheriting desktop navigation menu?
  98. Add child pages automatically to nav menu
  99. adding some custom html code to the wp_nav_menu function
  100. WordPress Menu Custom Walker Class
Categories menus Tags account, login, menus, user-registration
Custom on the fly e-mail alerts
Nested WordPress Shortcodes of Different Types

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
Ā© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress