In some layouts, you may wish to not use the WP-Members sidebar widget for logging users in, but you may still want to display a user’s login status (when logged in) and provide a logout link. Here is how you can do that with a plain text widget.
- Add a plain text widget to your sidebar
- Add a WP-Members status shortcode to the text widget:
[wp-members status="in"] You are logged in as [wp-members field="user_login"]. <a href="yourdomain.com/?a=logout">click here to logout</a> [/wp-members]
Note: you’ll need to set the appropriate logout link in the example above.
- You’ll need to verify that your sidebar can display shortcodes for this to work. If the logout link does not show when you are in a logged in state, you will need to enable shortcodes for the sidebar:
(See “Adding Shortcodes to Other Locations” for more information.)
The resulting widget should only display when the user is logged in and will display the user’s username and a link to logout. Customize as needed…