Conditional Menu Display | WordPress.org

[ad_1]

On my Menu, I have Login and Logout Menu items.

The Login link is an Elementor created Page.

While the Logout is an endpoint supplied by BuddyPress.

I have enabled CSS Classes in my Menu through Screen options.

So the Login link has a CSS Class of [ buddyx-elementor-login ] while the Logout link has a CSS Class of [ bp-menu bp-logout-nav ]

If people Login, I want the Login on the Menu to be hidden– because they are already logged in.

And if they Logout, I want the Logout on the Menu to be hidden– because they are already logged out.

Which PHP Code Snippets or CSS can help me achieve this?

Regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer