Skip Navigation

[Resolved] View loop and pagination – current index based on previous pages/results

This support ticket is created 8 years, 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Simon 8 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#352865

Hello,

I have a view with pagination (infinite scroll) that shows 30 posts on each result set.
In the view I would like to show specific post at index 5, 50 and 100.

The result now:
Index 5 is show on every result set.
Index 50 and 100 is never shown.

I guess the index counter is defaulted to 0 on every result set/new page. Is it possible to get the current "total index value"?

Example:
Each page view has 30 posts, this means that page 3 will begin with the "total index value" of 90 (91,92,93...).

Best regards,
Simon

#353093

Dear Simon,

Are you using Views shortcode [wpv-index] to specific post at index 5, 50 and 100?

If it is, yes, you are right, shortcode [wpv-index] only works in current page, if you enable the pagination settings in the view, you will need create other shortcode to get the "total index value",

For example, you can use the (current page number) * (posts per page) + [wpv-index]

#353139

Thank you Luoy!

You are correct, I'm using [wpv-index].
I will try to build a shortcode with your example.

Best regards,
Simon

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.