How To Call Footer On Custom Wp Login Page

As a WordPress developer, one of the tasks I frequently encounter is customizing the login page. Adding a personal touch to the login page not only enhances the user experience but also helps to create a consistent branding experience for your website. In this article, I will guide you through the process of calling the footer on a custom WordPress login page.

Before we dive into the technical details, let’s understand the structure of a typical WordPress login page. The login page consists of a header, a login form, and a footer. By default, the footer is not displayed on the login page. However, with a little bit of customization, we can add the footer to the login page.

To begin with, we need to create a custom login page template. Create a new PHP file in your WordPress theme folder and name it “custom-login.php”. Now, let’s start coding our custom login page.


<?php /* Template Name: Custom Login Page */ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Custom Login</title>
    <link rel="stylesheet" href="/style.css" />
</head>
<body class="login">
    <div id="login">
        <h1>Custom Login Page</h1>
        <form id="login-form" action="" method="post">
            <label for="user_login">Username:</label>
            <input type="text" name="log" id="user_login" class="input" value="" size="20" />
            <br />
            <label for="user_pass">Password:</label>
            <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" />
            <br />
            <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary" value="Log In" />
        </form>
    </div>
</body>
</html>

Save the file and navigate to your WordPress admin area. Go to “Pages” and create a new page. In the right panel, select the “Custom Login Page” template you just created. Publish the page.

Now, we have our custom login page ready. To call the footer on this page, we need to modify our custom login page template. Open the “custom-login.php” file in your theme folder again and add the following code just before the closing </body> tag:


<?php get_footer(); ?>

Save the file and refresh your custom login page. You should now see the footer displayed at the bottom of the login page.

Adding the footer to the custom login page enables you to include important links, copyright information, or any other content that you typically display in the footer of your website. Customize the footer by editing the footer.php file in your theme folder.

Conclusion

Customizing the WordPress login page is a great way to personalize the user experience and maintain consistent branding. By creating a custom login page template and calling the footer, you can add important content to the login page. Remember to test your custom login page thoroughly to ensure it functions correctly.

Now that you know how to call the footer on a custom WordPress login page, go ahead and customize your login page to make it truly unique!