Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
Is it possible to allow my customers to return to the same area of the page they were at previously? Currently when a customer clicks on the back button, it returns them to the previous page but they have to start at the very top. Hope that makes sense. Thanks for your help.
Never mind, didn’t realize that I needed a back button. I added one and all is well.
Hi Sunnydjl,
1. go to Online Store —> Themes
2. Click on Action and duplicate your theme for an Backup.
3. Click on Action again, Edit Code
4. Open your theme.liquid file.
5. Find the following code line (3 lines in total, you just need the middle one. ) Remove the line:
<main id="MainContent" class="content-for-layout focus-none" role="main" tabindex="-1">
Also remove the third line
</main>
6. Press Save
7. Reload your page and try it.
Works also on mobil.
hope that helps.
Reason is, that with this code line some content will not be loaded completely after the page load is done. So if you go to a new page there is no Y-Scroll Position to remember in case if you press the back button.
Have a great day, all my best,
Stefan
I had the same issue and removing this specific line of code you mentioned worked! Thank you so much!
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025