Display a simple login form anywhere with wp_login_form

Adding this snippet to your wordpress theme will display the login form. This is a great snippet if you want to display the login form in an unusual place within your template.
This first snippet will simply display the login form, use the second snippet if you wish to define specific options.

 

 

<?php
wp_login_form();
?>

<?php $args = array(
'echo' => true,
'redirect' => 'http://wpsnipp.com',
'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' => NULL,
'value_remember' => false );
wp_login_form($args);
?>

Leave a comment