Enable WordPress Auto-Login
March 30th, 2011 Category: WordPressYou may also think that loggin in every time you want to access the admin area of one of your WordPress blogs is quite annoying. But there is a quick way to enable the auto-login for WordPress. It’s shown below.
Add the following lines of code to the functions.php in theme directory:
function auto_login() {
if (!is_user_logged_in()) {
//determine WordPress user account to impersonate
$user_login = 'guest';
//get user's ID
$user = get_userdatabylogin($user_login);
$user_id = $user->ID;
//login
wp_set_current_user($user_id, $user_login);
wp_set_auth_cookie($user_id);
do_action('wp_login', $user_login);
}
}
add_action('init', 'auto_login');Source: lbsharp.com













hi
did you test this code?
this is a code from 2007
i test it on wp 3
do not work
it work for you?
It’ code is working.