Return to Snippet

Revision: 88487
at March 1, 2022 00:41 by chrisaiv


Updated Description
Simply paste the following snippet of code into your theme's functions.php file and adjust the CSS on line 4 as needed.

Revision: 88486
at March 1, 2022 00:41 by chrisaiv


Updated URL
http://chrisjmendez.com/2014/08/17/wordpress-custom-wp-login-php-through-functions-php/

Updated Code
chrisjmendez.com/2014/08/17/wordpress-custom-wp-login-php-through-functions-php/

Revision: 67155
at September 13, 2014 10:51 by chrisaiv


Updated Code
/** ******** ******** ******** ******** ******** ******** ******** ******** 
* TITLE: Beautify the Log-in Page
* DESCRIPTION: Make the Log-in Page PRetty
* 1: Change out Logo
* 2: Change out URL
* 3: Change out Title
* 
* http://codex.wordpress.org/Customizing_the_Login_Form
*/
function my_login_logo() { ?>
    <style type="text/css">
        body.login div#login h1 a {
            background-image: url(/wp-content/uploads/2014/07/logo-80x80.png);
            background-size: 80x 80px;
        }
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'my_login_logo' );

function my_login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'my_login_logo_url' );

function my_login_logo_url_title() {
    return 'GuitarPick';
}
add_filter( 'login_headertitle', 'my_login_logo_url_title' );

function no_errors_please(){
  return 'Please Try Again';
}
add_filter( 'login_errors', 'no_errors_please' );

Revision: 67154
at August 17, 2014 04:07 by chrisaiv


Updated Code
/**
* Customize wp-login.php
* 1: Change out Logo
* 2: Change out URL
* 3: Change out Title
* 
* http://codex.wordpress.org/Customizing_the_Login_Form
* 
*/
function my_login_logo() { ?>
    <style type="text/css">
        body.login div#login h1 a {
            background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/logo-80x80.png);
        }
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'my_login_logo' );

function my_login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'my_login_logo_url' );

function my_login_logo_url_title() {
    return 'TITLE OF WEBSITE';
}
add_filter( 'login_headertitle', 'my_login_logo_url_title' );

Revision: 67153
at August 17, 2014 02:42 by chrisaiv


Initial Code
//Theme login screen
function replace_login_logo() {
 $style = '<style type="text/css">';
 $style .= '#login h1 { background: url( ' .  get_stylesheet_directory_uri() . '/images/logo.gif ) no-repeat scroll center top transparent; display: block; height: 118px; overflow: hidden; padding-bottom: 15px; text-indent: -9999px; width: 369px; margin-left: -25px; }';
 $style .= '#login h1 a { display: none; }';
 $style .= '</style>';
 
 echo $style;
}
add_action( 'login_head', 'replace_login_logo' );

Initial URL
https://ethitter.com/2010/11/replacing-wordpress-logo-on-wp-login-php/

Initial Description
Simply paste the following snippet of code into your theme’s functions.php file and adjust the CSS on line 4 as needed.

Initial Title
Wordpress: Custom wp-login.php through functions.php

Initial Tags
login, wordpress

Initial Language
PHP