- This topic has 4 replies, 2 voices, and was last updated 11 years, 10 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › How to put LOG OUT in Navigation Menu?
Tagged: navigation menu, WP eMember
Hello. I want to put a LOG OUT button for logged in members. I’ve followed all the steps mentioned at http://www.tipsandtricks-hq.com/wordpress-membership/show-different-navigation-menu-to-your-members-and-non-members-551 but the problem yet persists.
I’m using the following code –
<?php
if ( wp_emember_is_member_logged_in() ) {
tfuse_menu(‘members’);
} else {
tfuse_menu(‘default’);
}
?>
But yet, the problem persists. But one thing is that the DEFAULT menu DOES display for NON-LOGGED-IN members, but the other menu does not display for logged-in members.
Is there anything I’m missing?
Anyone?
You don’t need to follow that tutorial just to add a “Logout” link in the navigation menu.
Simply create a link in your navigation menu with the following URL (this is will work as your logout link):
[http://www.your-domain.com/?event=logout]
Change the “your-domain.com” to your actual domain name.
Sorry for the bump.
But doing it this way will also show the LOGOUT tab to non-logged-in members. That’s why I though it’s a must to follow that tutorial.
Please guide me on the same.
Thanks
Okay yeah sure. Using the nav menu approach is better. You could also use the compact login widget in the header of your site:
With that said, in the above code you are using your theme specific function for the menu which I can’t help you with (this is something only your theme developer can only help). The proper way to add the WordPress 3.0 nav menu is to use the following code (given your theme supports it):
<?php
if ( wp_emember_is_member_logged_in() ) {
wp_nav_menu( array( 'menu' => 'logged-in-members' ) );
} else {
wp_nav_menu( array( 'menu' => 'normal-visitor-menu' ) );
}
?>