Navigation überspringen

[Gelöst] Different menu for logged in and logged offf user

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

I want to display different menus based on user login status and add user-friendly login and logout buttons in the menu.

Solution:

Use a plugin like WPCode to manage different menus based on user status. For the logout button, add a link with the URL http://example.com/wp-login.php?action=logout. Refer to the following documentation for generating the logout URL: https://developer.wordpress.org/reference/functions/wp_logout_url/.

Relevant Documentation:

How to Add the WordPress Logout Link to Navigation Menu: https://www.wpbeginner.com/wp-tutorials/how-to-add-the-wordpress-logout-link-to-navigation-menu/
WP Logout URL Documentation: https://developer.wordpress.org/reference/functions/wp_logout_url/

This support ticket is created vor 2 years. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Christopher Amirian vor 2 years.

Assistiert von: Christopher Amirian.

Author
Artikel
#2697260

Hello,

How do I achieve this? I was thinking about creaating two different menus and then using a plugin such as wp code to display the correct menu according to the user logged in status?
Is there something easier?

Aslo what are the links to put for login and logout?

Thanks

Jacques

#2697289

Christopher Amirian
Unterstützer

Sprachen: Englisch (English )

Hi Jacques,

Toolset does not have any control over the menus generated via Appearance > Menus on WordPress.

I did a Google search and there are some solutions that you can consider:

versteckter Link

Thanks.

#2697357

Ok thanks,

I will manage to do this.

Addititional question please : I want to add a logout button in menu.

What url should I use there, How can I make the url user friendly? Use a redirect?

Thanks,

Jacques

#2697656

Christopher Amirian
Unterstützer

Sprachen: Englisch (English )

Hi Jacques,

That is also something you should do without Toolset as Toolset does not have such a feature.

You can look for a solution here:

versteckter Link

According to that documentation, you can use a code like this:

<em><u>versteckter Link</u></em>

Here is the official WordPress documentation on such a URL generation:

https://developer.wordpress.org/reference/functions/wp_logout_url/

Thank you.

#2698177

Perfect,

Thanks a lot,

Jacques