Get the Official WPSaviour App Now!

Beginner’s GuideBlog

How to Add a Preloader Animation to WordPress (Step by Step)

Preloader - WordPress

Do it is advisable to add a preloader to your WordPress web site? A preloader is an animation indicating the progress of a page-load inside the background.

Preloaders assure clients that the website online is engaged on loading the online web page. This may assist improve particular person experience and in the reduction of the overall bounce value.

On this text, we’ll current you learn to merely add a preloader to WordPress.

Adding a preloader to your WordPress website

What’s a Preloader and When You Should Use it?

A preloader is an animation or standing message indicating the progress of page-load inside the background.

Normally whilst you go to an web web site, your browser begins downloading fully totally different parts of the content material materials. Some parts of the website online load sooner (i.e. textual content material, HTML code, CSS) whereas others load means slower (i.e images and films).

If most of your content material materials is textual content material with just a few images and films, you then undoubtedly don’t really need in order so as to add a preloader to your website online. As a substitute, it is best to take care of bettering website online velocity and effectivity for sooner net web page lots of.

Nonetheless, if most of your content material materials is images, photos, and video embeds, then your clients wish to attend a while sooner than they’ll actually see all the content material materials.

All through these partial downloads, your website online may actually really feel sluggish. Usually clients may even assume that it is broken. Together with a preloader fills this gap and reveals the particular person a progress indicator all through the online web page load.

You can see a keep occasion of a preloader by clicking on the Preview button whereas writing a weblog put up in WordPress.

WordPress will open a keep preview of your weblog put up in a model new window, and it will present a preloader sooner than it actually reveals the keep preview.

WordPress post preview preloader

That being talked about, let’s try how one can merely add a preloader to your WordPress website online.

Methodology 1. Together with a Preloader in WordPress using WP Good Preloader

This system is basically useful because of it is easier to implement and does not require any modifications to your WordPress theme.

Very very first thing you need to do is about up and activate the WP Smart Preloader plugin.

Upon activation, you need to go to Settings » WP Good Preloader net web page to configure plugin settings.

WP Smart Preloader settings

First, you need to choose a preloader trend or net web page load animation. The plugin comes with six built-in animations to pick from. You might also add your particular person custom-made HTML and CSS to create a custom-made preloader.

After that, it’s possible you’ll make the preloader appear solely on the homepage by checking the ‘Current solely on Home Internet web page’ chance.

Subsequent, you need to scroll all the way in which right down to the ‘Size to level out Loader’ half. That you will need to specify the interval for the preloader. The default chance is 1500 milliseconds (1.5 seconds) which should work for a lot of web sites, nonetheless you’ll change that when you want.

Set preloader duration and fade out

You might also set the time loader takes to completely fade out. The default chance is 2500 seconds or 2.5 seconds.

Lastly, don’t neglect to click on on on the ‘Save modifications’ button to retailer your settings.

Now you’ll be able to go to your website online to see the preloader in movement.

WP Smart Preloader Preview

Methodology 2. Together with a Preloader in WordPress using Preloader Plugin

This system is flexible nonetheless requires additional steps to accurately implement it in your WordPress web site.

The very very first thing you need to do is about up and activate the Preloader plugin.

Upon activation, you need to go to the Plugins » Preloader net web page to configure plugin settings.

Preloader settings

First, you need to enter the Hex code for the background color it is advisable to use for the loading show. The default chance is #FFFFFF (white). It is best to use an web color picker software program to go looking out the HEX code for the color it is advisable to use.

Subsequent, you need to current the URL of the preloader image it is advisable to use. The plugin comes with a default animation image.

In case you want to use totally different animation, you then undoubtedly’ll uncover a hyperlink to acquire an animated preloader image from a third-party website online. You can then add that image to your wp-content folder and paste the URL proper right here.

Subsequent, you need to choose the place it is advisable to present the preloader.

Select preloader locations

You can choose to indicate it on all pages of your website online, or you’ll select a specific half.

Lastly, you’ll observe the instruction in order so as to add the following code to your WordPress theme’s header.php file.

1
<div id="wptime-plugin-preloader"></div>

Sooner than you permit the online web page, don’t neglect to click on on on the ‘Save modifications’ button to retailer your settings.

We don’t advocate together with code to your WordPress theme because of it ought to get wiped off whilst you change the theme.

In case you might be using a teen theme, then it is okay in order so as to add the code to your teen theme’s header.php file.

greater decision will be in order so as to add this code using a separate Code Snippets plugin or in a site-specific plugin.

Proper right here’s the code you’d need in order so as to add:

1
2
3
4
function wpb_add_preloader() {
echo '<div id="wptime-plugin-preloader"></div>';
}
add_action( 'wp_body_open', 'wpb_add_preloader' );

Phrase: this method of together with code will solely work on WordPress themes which could be acceptable with the wp_body_open() function added in WordPress 5.2.

This system of together with the code makes optimistic that your code stays there even within the occasion you change the theme.

After getting added the code, you’ll go to your website online to see the preloader in movement.

Preloader preview

We hope this textual content helped you uncover methods to easily add a Preloader to your WordPress web site.

Download The WPSaviour App Now

Related posts
Beginner’s GuideBlogTutorials

Use Gutenberg like a pro with keyboard shortcuts

Beginner’s GuideBlogSecurityWordPress Security

A Simple Explanation of SSL Certificate Errors & How to Fix Them

Beginner’s GuideBest WordPress PluginsBlog

9 Best A/B Split Testing Plugins for WordPress

Best WordPress PluginsBlog

7 Best Plugins for Tracking User Activity in WordPress

Sign up for our Newsletter and
stay informed

Fear Of Missing Out?

Sign up with your email address to receive WordPress tips and updates
SUBSCRIBE NOW
Terms and Conditions apply
close-link
Click Me