WordPress.org

Ready to get started?Download WordPress

Forums

Thickbox and WP login (5 posts)

  1. privatestorm
    Member
    Posted 7 years ago #

    Has anyone used Thickbox for WP logins?

    (see Ajax Content examples here for login example)

  2. whooami
    Member
    Posted 7 years ago #

    nope, I do use a js popup box though. It degrades nicely, if the browser doesnt have js enabled, the regular page is displayed.

  3. carnold
    Member
    Posted 7 years ago #

    I have gotten a login box using thickbox using this code:
    < a href="http://www.<domain>.net/wp-login.php?height=475&width=600&modal=true" class="thickbox">Login< /a>
    What i would like to have happen from here is have the "Login" link, once someone is logged in, to change to "Logout". I have tried using < ?php wp_loginout(); ? > with the thickbox but this would not display the login page. How do i change "Login" to "Logout" once someone has logged in?

  4. privatestorm
    Member
    Posted 7 years ago #

    Maybe something like this?

    <?php global $user_login, $user_identity;
    get_currentuserinfo();
    if ($user_login) {
    echo "<a href=\"http://www.<domain>.net/wp-login.php?action=logout\">Logout< /a>";
    } else {
    echo "<a href=\"http://www.<domain>.net/wp-login.php?height=475&width=600&modal=true\" class=\"thickbox\">Login< /a>";
    }
    ?>
  5. justinic9
    Member
    Posted 6 years ago #

    I've been trying for hours to get something to work. The problem with carnold's solution (and hcm's for that matter) is that after the login, the page redirects to the admin panel, defeating the entire purpose of thickbox. Is there a way to have it redirect back to the current page? For example, I love the way the AJAX Login plugin works, but I don't want the widget. So, if I could get the function of AJAX Login put into a thickbox, I'd be thrilled.

    And I'm not tied to thickbox, but it seems the best way to go. If, however, Whooami wanted to share his knowledge, I'd be interested.

Topic Closed

This topic has been closed to new replies.

About this Topic