• gencharitaci

    (@gencharitaci-1)


    0 down vote favorite

    I created a custom entire page with login form, and called as entire.php with this code:

    <?php
    global $current_user;
    get_currentuserinfo();
    ?>

    <?php
    // If user not logged in;

    if (!(current_user_can(‘level_0’))){ ?>

    <form id=”login” action=”<?php echo get_option(‘home’); ?>/wp-login.php” method=”post”>
    <fieldset id=”inputs”>
    <input id=”log” name=”log” type=”text” placeholder=”Username” value=”<?php echo wp_specialchars(stripslashes($user_login), 1) ?>” size=”20″>
    <input id=”pwd” name=”pwd” type=”password” placeholder=”Password” size=”20″>
    </fieldset>
    <fieldset id=”actions”>
    /wp-login.php?action=register”>Register/wp-login.php?action=lostpassword”>Forget?
    <input type=”submit” id=”submit” name=”submit” class=”button” value=”Log In”>
    <input type=”hidden” name=”redirect_to” value=”<?php echo home_url(); ?>”>
    </fieldset>
    </form>

    <?php }
    //If user already logged in;
    else { ?>
    <?php wp_redirect( home_url() ); exit; ?>
    <?php }?>

    I want if user visited my website and not logged in yet, user must see entire.php and after logged in using form on entire.php, redirect to my homepage.

    How can i success this issue?

  • The topic ‘Redirect from entire.php to homepage after login’ is closed to new replies.