• Resolved yknivag

    (@yknivag)


    I’m currently using the login widget to allow users to log in to my site which works very well.

    It is very simple to use the widget to set a specific piece of text to display instead of the form when users are already logged in. Is it possible to have the widget display a “Log Out” button when a user is logged in?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Caseproof LLC

    (@caseproof)

    Hi @yknivag

    You can add this code at the end of your theme’s functions.php file:

    
    add_shortcode('members_logged_out', function() {
      return '<a href="' . wp_logout_url( home_url() ) . '">Logout</a>';
    });

    and then use this shortcode [members_logged_out] in the “Logged in text” field in the Login Form widget.

    Hopefully, that helps.

    Thread Starter yknivag

    (@yknivag)

    Hi @caseproof, thank you for the very quick and comprehensive response!

    I’ve tried the code and it provides a log out link which is excellent. I’ll add some styling to turn it into a button.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Log out button’ is closed to new replies.