Home » Php » php – Customizing wordpress navigation header with woocommerce my account

php – Customizing wordpress navigation header with woocommerce my account

Posted by: admin February 25, 2020 Leave a comment

Questions:

I am new to wordpress and I was creating a eCommerce website with woocommerce, then I have an idea to make an custom navigation header where when user is not log in it will show login/register and when login it will show to name of the customer.

User not login

enter image description here

How to&Answers:

There are a few ways you can achieve this.

The easiest option is to use any one of the below plugins. Using these plugins, you can show/hide menu items based on their login status. These plugins also allow you to customize the menu based on User roles as well.

https://wordpress.org/plugins/nav-menu-roles/

https://wordpress.org/plugins/user-menus/

Or you can assign a custom class to the menu item and then you can hide/show them using CSS. “logged-in” class is added to the BODY tag when a user is logged in.