Skip to content

Instantly share code, notes, and snippets.

@webmasterninjay
Last active March 8, 2021 15:56
Show Gist options
  • Select an option

  • Save webmasterninjay/3f8c567eaa78cf440cdf1b73855ff0f7 to your computer and use it in GitHub Desktop.

Select an option

Save webmasterninjay/3f8c567eaa78cf440cdf1b73855ff0f7 to your computer and use it in GitHub Desktop.

Revisions

  1. webmasterninjay revised this gist Mar 8, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions login.php
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    <?php

    // Customized login page
    function jay_custom_login_page() {
    function theme_prefix_custom_login_page() {
    $custom_logo_id = get_theme_mod( 'custom_logo' ); // image from cusomizer logo
    $image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
    $bg = get_stylesheet_directory_uri() . '/images/bg.jpg'; // change url to your preferred image
    @@ -37,4 +37,4 @@ function jay_custom_login_page() {
    </style>
    <?php
    }
    add_action('login_enqueue_scripts','jay_custom_login_page');
    add_action('login_enqueue_scripts','theme_prefix_custom_login_page');
  2. webmasterninjay revised this gist Mar 8, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions login.php
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,8 @@ function jay_custom_login_page() {
    background: url('<?php echo $bg; ?>') no-repeat center;
    background-size: cover;
    background-attachment: fixed;
    display: grid;
    align-content: center;
    }

    body.login div#login h1 a {
  3. webmasterninjay revised this gist Apr 8, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion login.php
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ function jay_custom_login_page() {
    ?>
    <style type="text/css">
    body.login {
    background: url('<?php echo $hero; ?>') no-repeat center;
    background: url('<?php echo $bg; ?>') no-repeat center;
    background-size: cover;
    background-attachment: fixed;
    }
  4. webmasterninjay revised this gist Apr 8, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions login.php
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    <?php

    // Customized login page
    function jay_custom_login_page() {
    $custom_logo_id = get_theme_mod( 'custom_logo' ); // image from cusomizer logo
    $image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
  5. webmasterninjay created this gist Apr 8, 2020.
    37 changes: 37 additions & 0 deletions login.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    <?php

    function jay_custom_login_page() {
    $custom_logo_id = get_theme_mod( 'custom_logo' ); // image from cusomizer logo
    $image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
    $bg = get_stylesheet_directory_uri() . '/images/bg.jpg'; // change url to your preferred image
    ?>
    <style type="text/css">
    body.login {
    background: url('<?php echo $hero; ?>') no-repeat center;
    background-size: cover;
    background-attachment: fixed;
    }

    body.login div#login h1 a {
    background: url('<?php echo $image['0']; ?>') no-repeat center;
    background-size: 100%;
    width: 320px;
    }

    body.login div#login {
    background-color: rgba(255,255,255,0.8);
    margin: 40px auto;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 3px;
    }

    body.login div#login .privacy-policy-page-link {
    text-align: center;
    width: 100%;
    margin: 1em 0 1em!important;
    }
    </style>
    <?php
    }
    add_action('login_enqueue_scripts','jay_custom_login_page');