Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make custom login in Wordpress

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 120
    Comment on it

    Hello Friends,

    Here we will discuss about custom login functionality in Wordpress. Please follow the below example to build custom login functionality in Wordpress:

    $userCredential = array();
    $userCredential['user_login'] = $_POST['username']; //get your login form info submitted as user name
    $userCredential['user_password'] = $_POST['password']; //get your login form info submitted as password
    $userCredential['remember'] = true;  // If you want to save data in cookies to remember this
    
    $userStatus = wp_signon( $userCredential, false );  //wp_signon is a custom function for login functionality
    if (is_wp_error($userStatus)){
     echo $userStatus->get_error_message();  // if login fail it will display the error
    }else{
     wp_redirect('userprofile');  // after successful login page will redirect to userprofile page  
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: