Hi everyone,
I need your help.
The theme is Envy With Edits | Eight 23 November.
I "d like to know how to add pagination to the infinity scroll (“load more”) by adding the rel=“next” and rel=“prev” pagination attributes so that “page 2” (and so on) appears in the URL. Because right now the URL address does not change and Googlebot cannot reach all the products.
Thank you in advance!
Hello @Giulia9 ,
Welcome to Shopify Community!
To add the “rel=‘next’ and rel=‘prev’” pagination attributes to the infinity scroll (or “load more”) feature in the Envy theme, you will need to make some modifications to the theme code. The exact process will depend on how the infinity scroll feature is implemented in your theme, but here’s a general overview of what you’ll need to do:
-
Identify the code that handles the infinity scroll feature: Look for JavaScript code that listens for a scroll event and loads more content when the user reaches the bottom of the page.
-
Add the “rel=‘next’” attribute to the link that loads the next page of content: When the user reaches the bottom of the page, the code should append a link to the next page of content to the DOM, with “rel=‘next’” attribute.
-
Add the “rel=‘prev’” attribute to the link that loads the previous page of content: You will also need to add the “rel=‘prev’” attribute to the link that loads the previous page of content.
-
Add unique URL for each page: You will also need to add unique URLs for each pagination page.
-
Test your changes: Once you’ve made these changes, test them on your website to ensure that the pagination attributes are working as expected.
It is important to note that you might need to have some development knowledge and skills to make this changes and it’s also important to keep a backup of the theme before making any changes. Alternatively, you can consider hiring a Shopify developer to help you implement this change if you are not confident in your own abilities.
It’s also to note that the above steps are just general overview and more specific instructions will depend on the theme you’re using and how it’s implemented.