How can I add a 'scroll to top' button in my theme?

Hi,

I am trying to add a scroll to the top button to this button when you press it.

What code do I need to do this? It’s okay if it’s complex, I’m not a complete newbie with coding.

Also, is it going to be a problem if the button doesn’t link to anything. Because it’s greyed out right now and you can’t press it. I’ve tried linking it to a page and I get an error saying ‘online store editor session can’t be published.’

My product page is https://basicallysuperhuman.com/products/train-like-a-superhero-ebook

Thank you!

Hello @BasicallySuper ,

It’s the GemPages Support Team and we are glad to assist you today!

I would like to give you the recommendation to support you so kindly follow the steps below:

  1. Go to Online Store > Theme > Edit code of your current theme

  1. Open your theme.liquid theme file

  2. Paste the below code before


Let us know how it works for you.

Best regards,

GemPages Support Team

Hi @BasicallySuper

This is Victor from PageFly - Shopify Page Builder App

Please add this code to your theme.liquid above the to get this solved

Step 1: Online Stores > Themes > More Actions > Edit code

Step 2: click on theme.liquid and paste the code above the


Hope this can help you solve the issue

Best regards,

Victor | PageFly