• I’m using the following code to generate a login form on a WordPress Page. The code is included in the template file and appears before the “the_content.”

    <?php if (!(current_user_can('level_0'))){ ?>
    
    <form action="<?php echo get_option('home'); ?>/wp-login.php" method="post">
    	<input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="20" />
    	<input type="password" name="pwd" id="pwd" size="20" />
    	<input type="submit" name="submit" value="Send" class="button" />
    </form>
    
    <?php } ?>

    My navigation includes a separate section that appears only if the user is logged in (an if statement). This part works great.

    The problem I’m running into is that once a user logs in on the “login page” they are immediately redirected to the dashboard. In this case, I’d like to keep these specific users from ever encountering the dashboard. I want to redirect them to the login page – and show the content of that page.

    How can I do this?

The topic ‘Redirecting Users after Login’ is closed to new replies.