2.4k questions

2.4k answers

99.5k users

Categories

0 votes
83 views

How do I create a WordPress login page without a plugin?

in WordPress by (95.8k points)

1 Answer

0 votes

The best way to create a login page in WordPress without using a plugin to the site is to create a custom page with the custom template and use WP_login_form() function to publish the plugin form on the page

<form action="<?php the_permalink(); ?>" method="post" class="sign-in">
    <p>
        <label for="user-name"><?php _e('Username'); ?></label><br />
        <input type="text" name="user-name" id="user-name" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
    </p>
    <p>
        <label for="password"><?php _e('Password'); ?></label><br />
        <input type="password" name="password" id="password" />
    </p>
    <p>
        <input type="submit" name="submit" value="<?php _e('Log in'); ?>" id = "yellow-button" />
        <input type="hidden" name="action" value="log-in" />
    </p>   
</form>
see https://wphow.co/kb/how-to-add-a-login-page-in-wordpress/
by (95.8k points)
...