How to add Back to Top Scrolling Button in WordPress

Scrolling Button is very helpful if you have a very long articles on your website. It helps your readers to go back to top smoothly.

So here are the steps to help you to have a scrolling button or smooth scrolling button.

Step 1

Make sure you have the jQuery library in your WordPress site. To check you can right click and view source on your website.

Step 2

Open and Add this script in your header.php or footer.php, which do you prefer.

Step 3

Open your footer.php and add this code.

Step 4

Open your style.css and add this style for your button.


Now check your website if you have the Go top button in your site.

Here is a demo

See the Pen Scrolling to Top by DrewCodeSpot (@drewcodespot) on CodePen.