Login with OpenID, similar to Stack Exchange sites?
Try Make Your Site Social plugin which does most of the job for you
Try Make Your Site Social plugin which does most of the job for you
This will need to go in a plug-in, just put the following inside a file (login-languge.php) in wp-content/plugins/ /* Plugin Name: Log-in Language Plugin URI: http://wordpress.stackexchange.com/questions/72692/how-do-i-change-the-language-of-only-the-login-page Description: Changes the language for log-in/register screens only Author: Stephen Harris Author URI: http://stephenharris.info Version: 1.0 License: GNU GPL 2 */ add_action(‘plugins_loaded’, ‘wpse72696_login_language_init’); function wpse72696_login_language_init(){ if( in_array( $GLOBALS[‘pagenow’], array( … Read more
Found it already, to do this you can use the ‘user’ object: {% if user %} Hello {{ user.user_nicename }} {% else %} you are not loggedin {% endif %}
While coding a custom login page, one needs to take care of the errors, else WordPress would redirect the page to /wp-admin or wp-login.php on wrong passwords or empty credentials. Please follow the below to solve this issue:– Please use the below in your theme’s functions.php file:- /** * Function Name: front_end_login_fail. * Description: This … Read more
I think I’ll wait for such a plugin Save this code in a file named set-cookie-expire.php and upload it your plugins folder. The plugin will give you the ability to set a time (in days) that cookies expire within the WordPress Settings admin. <?php /** * Plugin Name: Set Cookie Expire * Plugin URI: http://wordpress.stackexchange.com/a/11991/1685 … Read more
Whenever a new user is created, this function will add a custom field with value 1. function function_new_user($user_id) { add_user_meta( $user_id, ‘_new_user’, ‘1’ ); } add_action( ‘user_register’, ‘function_new_user’); The next function will check if it’s the first login and redirect the user. function function_check_login_redirect($user_login, $user) { $logincontrol = get_user_meta($user->ID, ‘_new_user’, ‘TRUE’); if ( $logincontrol ) … Read more
If I were you, I would look at solutions with Federated Identities. For example OpenID solutions. This link has a lot of examples of implementation on PHP. Advantages: open source, secure protocols, clear documentation
I add one function wp_set_current_user for setting up current user. add_action( ‘wp_ajax_facebook_login’, ‘facebook_ajax_login_or_register’ ); add_action( ‘wp_ajax_nopriv_facebook_login’, ‘facebook_ajax_login_or_register’ ); function facebook_ajax_login_or_register(){ $uid = sanitize_text_field( $_POST[‘uid’] ); $args = array( ‘meta_key’ => ‘fbuid’, ‘meta_value’ => $uid, ‘meta_compare’ => ‘=’, ); $fb_user = get_users($args); $current_user_id = $fb_user[0]; wp_set_current_user($current_user_id);//Set current user wp_set_auth_cookie( $current_user_id, true ); $response[success] = true; echo … Read more
insert this in form: <p class=”forgetmenot”><label for=”rememberme”><input name=”rememberme” type=”checkbox” id=”rememberme” value=”forever” /> Remember Me</label></p> In backend, like this: $credentials[‘user_login’] = $_POST[‘log’]; $credentials[‘user_password’] = $_POST[‘pwd’]; $credentials[‘remember’] = $_POST[‘rememberme’]; ….. wp_signon($credentials) ….
Normal cookies, as used by WordPress to keep you logged in for a certain period, are the way to check whether a user is logged in. Even if you close your computer they will be there when you switch it on again. Session tokens are something different. They are meant to transfer information between several … Read more