Solution:2
First, we need to create a custom page template for the login page. To do so, you can create a new page template and name it – for example – page-login.php
. Then, create a new Page from the WordPress backend and set the permalink to login
so that WordPress will automatically take the page-login.php
template for the page.
First, we need to create a custom page template for the login page. To do so, you can create a new page template and name it – for example – page-login.php
. Then, create a new Page from the WordPress backend and set the permalink to login
so that WordPress will automatically take the page-login.php
template for the page.
<?php
$args = array (
'redirect' => home_url(),
'id_username' => 'user' ,
'id_password' => 'pass' ,
)
;?>
<?php wp_login_form( $args ); ?>
|
Furthermore, you can also add something aside. It could be your logo and a little description of your site, for example.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
< div class = "login-branding" >
< a href = "#" class = "login-logo" >Hongkiat.com</ a >
< p class = "login-desc" >
Hongkiat.com is a design weblog dedicated to designers and bloggers. We constantly publish useful tricks, tools, tutorials and inspirational artworks.
</ p >
</ div >
< div class = "login-form" >
<? php
$ args = array (
'redirect' => home_url(),
'id_username' => 'user',
'id_password' => 'pass',
)
;?>
<? php wp_login_form( $args ); ?>
</ div >
|
Now, let’s make the form nicer with CSS. You can make the CSS up on your own as per your site requirements. In this example, here is how my login form looks like. It has black background, with a blue button, which fits quite well with the Hongkiat.com site theme.