Login Redirect (hide link after login) (1 post)

  1. ktrusak
    Posted 4 years ago #

    I wanted to use the login function from the wordpress codex page:
    <a href="<?php echo wp_login_url( get_permalink() ); ?>" title="Login">Login</a>

    To allow users to redirect back, but I wasn't sur how to reformat it to be place in this conditional, can anyone help?

    if (is_user_logged_in()){
       global $current_user; get_currentuserinfo();
       echo('<div class="welcome-banner">Welcome ' . $current_user->user_firstname .'</div>');
    } else {
    echo ('<a href="wp_login_url( get_permalink() );">Login</a>')

Topic Closed

This topic has been closed to new replies.

About this Topic