Home / admin / Display wordpress login form anywhere with wp_login_form
  • How to Display wordpress login form anywhere with wp_login_form


    Depending on how you are using WordPress you may have given users the ability to register to your website. Now all you need is a simple and beautiful way to let them register. This snippet will provide a simple way of adding that login form. Just add the first snippet in the location of your theme you wish to display the login form.

    wordpress snippet : PHP - default login form


    The following more advanced login snippet includes an array of arguments that you can use to customize your login form even more. Some options are the labels username, pass, and of course the login redirect URL so you can specify a specific page a user is sent to after login.

    wordpress snippet : PHP

    <?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 );

    ( WordPress codex functions, hooks, in this snippet. )

    wp_login_form, __, wp,
  • CHris

    How do i make it so it includes the Lost Password link? how do i include an ARG in the

  • http://www.iamniloy.com Niloy Sarker