How to Customize Default Theme Background Image with Hook

LoginPress plugin allows you to easily customize your login page straight from your WordPress admin dashboard! As soon as you Install and Activate the LoginPress, you’ll notice that your WordPress Default Login Page reverts to the LoginPress Default Theme automatically. 

Default LoginPress Theme Background Image

Let me describe a scenario for you; you are using the LoginPress plugin on the Multisite Network and want to change the default LoginPress Theme Background image on all websites. What would you do?

This knowledgebase article will show you how to customize the LoginPress default Theme Background image with a hook while using Multisite Network.

Adding the LoginPress default Theme Background image will be done with coding, so buckle up!

Customizing LoginPress Default Theme Background Image while using Multisite Network

If you want all the sites on your Multisite network to use the other than LoginPress default Theme Background image on the login page, add a hook in your main website theme's functions.php file.

Note: It’s recommended to use a child theme to edit the functions.php file instead of the parent theme. There are chances to lose the modified code when you update your theme. It might cause some adverse effects on your website.

Here is the hook:

function loginpress_default_bg_callback( $background ) {
  $background = 'https://cdn.pixabay.com/photo/2019/07/19/09/40/flowered-balloon-flower-
4348351_960_720.jpg';
  return $background;
}
add_filter( 'loginpress_default_bg', 'loginpress_default_bg_callback' );

Note: Here, $background contains the URL for the background image. You can change the image to any image of your choice simply by replacing the URL. Ensure the image is optimized. Otherwise, it can cause the login page to load slowly.

Once you’ve added the hook in the main website theme's functions.php file, the default LoginPress themes background will look like this:

Customizing the Default Theme Background Image

All done! Now it’s your turn! Try to customize the LoginPress default Theme Background image with a filter, and let us know how much it helped you!
If you have any doubts or questions related to this matter, please don’t hesitate to contact our support team.

Still stuck? How can we help?

Updated on April 18, 2024

Documentation
triangular shape yellowish icon

Frequently Asked Questions (FAQs)

These FAQs answer the most common questions about our WordPress custom login page plugin.

after animated element
three shapes icon

Where can I get support for LoginPress?

If you need help with LoginPress, you can contact us here. We’ll be happy to answer any questions about the plugin.

Do you have an affiliate program?

Yes, we have an affiliate program that you can sign up for here. As an affiliate, you’ll earn a commission on every sale you refer to us.

Do you offer refunds?

Yes, we offer a 14-day money-back guarantee on all of our plans. If you’re unsatisfied with LoginPress, simply contact us within 14 days of your purchase, and we’ll process a refund.

Can I upgrade my license after my initial purchase?

Yes, you can upgrade your LoginPress license at any time. Simply log into your account and go to the My Downloads page. From here, you can upgrade your license and download the latest version of the plugin.

Will LoginPress slow down my website?

No, LoginPress will not slow down your website. The plugin is lightweight and only loads the necessary files when someone tries to access your login page.

three shapes icon

If you Still have Questions?

Get In Touch
Hurry up!! Limited Time Offer  - Get  20% Off  on LoginPress 
Discount Code: EARLY20 
Special Offer on LoginPress
close-image