Skip Navigation

[Resolved] Infinite scroll with hash link

This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 4 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#1302813

I created a view for custom post type with infinite scrolling and added view shortcode in a page called book.

In another page i created a link with hash id "book-info" (<a href="example.com/book/#book-info">book-info</a>).

In a post of custom post (that is in book page) I added this id to a div (<div id="book-info"></div>).

so i want that if we click on link with hash then page open, infinite scrolling will scroll to that div in post where is id added.

Is this possible?

#1302861

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

It depends exactly what you mean.

Anchor links will work for content that is already on the page, but cannot be used to trigger updating the page so that content which is not initially present is loaded.

So if your View with infinite-scroll pagination initially loads 10 posts, then the anchor link would work if the post being linked to happened to be one of the first 10, but if you were trying to link to the 23rd post in the results, then, no, it wouldn't work, the id wouldn't be found and so the page would simply load at the top.

#1302877

Is there a way to get a page URL update once the page is scrolled...

I mean, when user go to the page for the first time it would appear simply as domain.com/page/

But once user reaches to the end then another page loads automatically, can the url be changed (updated) to domain.com/page/1 now and /page/2 and so on..when new page loads up..... so that I can have the #id added to that specific page.. domain.com/page/2#gohere thus making it work in infinite scrolling...

Please help on this.

#1302975

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

This isn't possible with infinite scroll.

You can do it when you have manual pagination links on the page (even if the pagination updates via ajax if you update the settings so that the URL updates), but you need to include the full links for different pages that also include the View id etc., so they would look something like this:

<em><u>hidden link</u></em>
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.