Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress Customizing the WordPress Admin Area Customizing the WordPress Login Screen How to Customize the WordPress Login Screen via functions.php

Stavros Sofroniadis
PLUS
Stavros Sofroniadis
Courses Plus Student 1,503 Points

About Change the Login Logo

It was mentioned that in order to change the WordPress logo to your own, you will need to change the CSS styles associated with this heading:

<h1><a href="http://wordpress.org/" title="Powered by WordPress">Your Site Name</a></h1>

The above is <h1> link to WordPress Home Page, but dont understand if <h1>> tag relates to WordPress logo image.

Please mention if there is a correlation between <h1><a href="http://wordpress.org/" title="Powered by WordPress">Your Site Name</a></h1> & WordPress logo image.

It was mentioned in WordPress codex https://codex.wordpress.org/Customizing_the_Login_Form the following: "You can use the login_enqueue_scripts hook to insert CSS into the head of the login page so your logo loads instead." (under header Change the Login Logo -3rd line)

Dont understand if you explainwhat is saying,

In WordPress codex was mentioned that we place the following code to a functions.php file function my_login_logo() { ?> <style type="text/css"> #login h1 a, .login h1 a { background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/site-login-logo.png); height:65px; width:320px; background-size: 320px 65px; background-repeat: no-repeat; padding-bottom: 30px; } </style> <?php } add_action( 'login_enqueue_scripts', 'my_login_logo' );

We have the body of function named my_login_logo() where we apply some css to 2 selectors(#login h1 a, .login h1 a) a)we insert a desired logo image if could explain the code <?php echo get_stylesheet_directory_uri(); ?> what is done?

b)we set height and image of the photo c)we define bacground-size of the image. Dont understand if difrence between contain and cover, if you could assist, .

d)we determine padding-bottom(the distance of image text with border of selector)

Afterwards we have a call of action my_login_logo add_action( 'login_enqueue_scripts', 'my_login_logo' );

But if you explain the above code, add_action & login_enqueue_scripts not understable

Thank You,