Hi, I’m new here. I would like help creating an anchor link on my shop all page so that when I click from my home page, it takes me to the relevant section. I have it set up as featured collections that show on the home page and are then listed vertically on the shop page.
Hi @info_15535,
You can use link href=“#ID” to do this, refer link
Hope it is clear to you
Hey @info_15535 ,welcome to the Shopify Community!
To create an anchor link from your homepage to a specific section (like a featured collection) on your Shop All page:
- On your Shop All page, add an id to the section you want to scroll to:
<div id="collection-one">
<!-- your collection content -->
</div>
- On your homepage, link to that section using the full URL + anchor: html Copy Edit
<a href="/collections/all#collection-one">Shop Collection One</a>
When the link is clicked, it will scroll directly to the section with the matching id.
If you want me to help you implement this, please feel free to reach out — thanks!
Best Regards,
Rajat
Shopify Expert
Hey @info_15535,
Could you please share your store URL and password [if applicable] so that I can take a look and provide you solution code.
Looking forward to hearing back from you.
Thanks
There are several ways to add an anchor.
As already mentioned, you’d need to add a id=anchor attribute to any element.
Each section has its own automatically generated id, so one option is to use those ids, but they may change and also they are cryptic, so would not look good in your url.
I recommend using a “Custom liquid” section instead and paste code like this:
<div id=anchor><div></dv></div>
where you can use meaningful id instead of “anchor”
Insert this section right before your featured collection section.
Than you can use any section/block which allows you to create a link and use a #anchor as the address.
(There is an extra div in the code above – many themes have a rule to hide elements which has nothing in them and we do not want our anchor element to be hidden.
Also, padding set to 0 so this section does not add a gap on your page.
)
Hi! Welcome!
To set up an anchor link, you’ll need to assign an id to each featured section on your Shop All page, then link to it from your homepage using #section-id. I can walk you through it step by step or send code if needed — just let me know!
