0

I want auto-login from back-end whenever i log-in from frontend. I am using AjaxBootmodalLogin plugin to log-in from frontend. In localhost when i login from frontend then i automatically logged in from back-end too but it is different in live. Please give me some solution.

0

wordpress default provides the functionality when you login from frontends then it will login from backends too. so there is no need any extra plugins or code. just you need to display the wordpress login form in front-ends and which is really very simple. please add below code in your wordpress login-template to login frontend and backend(i mean auto login as you want).

<?php $args = array(
        'echo'           => true,
        'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
        'form_id'        => 'loginform',
        'label_username' => __( 'Username' ),
        'label_password' => __( 'Password' ),
        'label_remember' => __( 'Remember Me' ),
        'label_log_in'   => __( 'Log In' ),
        'id_username'    => 'user_login',
        'id_password'    => 'user_pass',
        'id_remember'    => 'rememberme',
        'id_submit'      => 'wp-submit',
        'remember'       => true,
        'value_username' => '',
        'value_remember' => false
);
wp_login_form( $args ); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.