How To Add A Background Image To WordPress Login Page?
February 4th, 2017 | by Ravi Chahar || 15 Comments |
To customize the login page of your WordPress website, you can do a lot of things.
You can customize WordPress login page background, you can change login error message and many others things.
Have you ever thought to add an attractive background image? Yes, you can give a new look to your login page with a custom image.
Many people use the plugins for the customization, but here you will learn the easiest method with a few lines of the code.
To add a background image to WordPress login page, you just have to add a WordPress function consisting the path of the image.
Find And Edit The functions.php file of Your WordPress Theme.
You should know that for a WordPress theme, the functions.php file is one of the most important files.
You can add new features to your website using this file.
To give a better design to your login page, use this file.
You can open it from your WordPress admin panel. Go to Appearance>>Editor>>functions.php file.
If you’re not able to login then access it from the cPanel of the web hosting account.
Go to cPanel>>file manager>>wp-content>>themes>>theme name>>functions.php file.
Open the file and place the code.
echo ‘<style type=”text/css”>
background-image: url( “http://example.com/wp-uploads/image.png” )!important;
This is an example of the code which would help you.
NOTE:- You have to replace the path of the image with the real path where you upload that image. Whether you upload the image to your media library or add it in the theme folder.
The path of the image should be correct.
It’s always recommended to choose the image of the bigger size so that it can fit the whole screen.
If you use any image of the narrow dimensions then it will get repeated. The normal dimensions of a computer screen are 1920px×1080px
Suppose one of your users have an HD screen computer and you add a smaller image then it won’t look good.
After adjusting the path and the image, save the code and you will see the result.
You have successfully added a custom background image to your WordPress login page.
Did You face Any Problem During The Process?
Many bloggers are afraid of using the codes. But if you do it carefully then you can do a lot of things with this CMS.
The above-shown code can help you add a background image to WordPress login page without creating any separate file.
Many users add a new file just to add this code, but what’s the need?
Did that code work for you? Did you face any problem? If you do then feel free to contact us.