How to add a scroll back to top of page in WordPress? – I am sure there are a dime a dozen tutorials and plugins on this subject – here is the solution I went with.

jQuery scrollToTop was my choice of poison, download and install the scrollToTop.min.js file in your theme’s js folder and create an init file with the following…

View the code on Gist.

Name it scroll-init.js and also move the init file to your theme’s js folder…

Enqueue these files by adding this to your functions.php

View the code on Gist.

Now create the echo out the HTML link tag also add to functions.php

View the code on Gist.

And some CSS for your style.css to get the party started…

View the code on Gist.

Share:

Leave a Reply