Disclaimer

This blog is kind of my own personal work Notebook, and the processes below are only guaranteed to work for my specific configurations. So, use this info at your own risk, and please understand I won't be able to provide any help if you break something

Thursday, August 12, 2021

Customizing the WordPress login Page

The Problem: 


The Solution: 

Add to functions.php


// Login Page

function rmm_custom_login_page() { ?>

    <style type="text/css">

        #login h1 a, .login h1 a {

        background-image: url(https://example.com/wp-content/uploads/logo-image.jpg));

        height:150px;

        width:300px;

        background-size: 300px 150px;

        background-repeat: no-repeat;

        padding-bottom: 10px;

        }

body.login {

        background-color: #89b2e0;

        background-image: url(https://example.com/wp-content/uploads/background-image.jpg);

background-size: cover;

background-repeat: no-repeat;

background-attachment: fixed;

background-position: center;

        }

.login #nav, #backtoblog {

        background-color: white;

padding: 5px 25px!important;

}

    </style>

<?php }

add_action( 'login_enqueue_scripts', 'rtm_login_logo' );


function rmt_login_logo_url() {

    return home_url();

}

add_filter( 'login_headerurl', 'rmt_login_logo_url' );


function rmm_login_logo_url_title() {

    return 'Logo Title';

}

add_filter( 'login_headertext', 'rmm_login_logo_url_title' );

<?php }

add_action( 'login_enqueue_scripts', 'custom_login_page' );


No comments:

Post a Comment