Support » Theme: Blackoot Lite » Adding a loader to my site

  • Resolved sifinley

    (@sifinley)



    Is there anyway I can add a spinning loader to my site when people first visit it? My site takes around 5 seconds to load the homepage so I want to add a loader so that it shows that it is actually loading. I’ve googled it and added some css code but I’m not sure where to add the HTML code.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Iceable

    (@iceable)

    If you need to add HTML, this can be done in a theme file. Which files depends on where you need to add your HTML.

    Usually such code would be added either just after the <body> tag which would be in header.php, or at the end before </body> which would be in footer.php.
    You could edit these files from Appearance > Editor but this is strongly discouraged: if you edit a file from the theme directly, any future update of the theme will get rid of your changes because updates overwrite every file.
    Tthe proper way to avoid this is to create a child theme, then copy the file you want to edit in the child theme and edit this copy.

    If I may make a suggestion however a spinning loader is probably not the best solution for your loading time problem: it would be actually one more thing to load so the overall load time would become even longer, and the loader itself may not even load and show instantly.

    A better approach IMO would be to work on making your site load faster.

    How to do this is way beyond the scope of theme support but to get you started the first quick steps with high-results I would recommend are:
    – Enable gzip compression. This alone can reduce your load time by 50%. Here’s quick tutorial I wrote: https://www.iceablethemes.com/how-to-speed-up-your-wordpress-site-with-gzip-compression/
    – Use a caching plugin. Among the most popular are WP super cache and W3 total cache. Pick one (never install both at the same time!) and take a few minutes to make sure to tweak the settings – google it for info and tutorials – and it will also make quite a difference.

    Thank you for the replies. I have actually got my site load time down quite a bit since I posted this. Tried that W3 total cache plugin and deleted some unused plug ins. Made quite a difference. I still want to get it down a bit more so I will try that gzip compression.

    Many thanks for the advice guys 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding a loader to my site’ is closed to new replies.