WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. ktrusak
    Member
    Posted 2 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?

    <?php
    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