hey,
i have an ordered list with pagination. i show 10 results each page. but right now the count of the list begins at "1" and ends at "10" on each page.
is there a way for the order to continue with pagination? e.g start the 2nd page with "11" instead of "1", and the 3rd page with "22" instead of "1" again...
thanks!
Hi there,
Thank you for contacting us and I'll be happy to assist.
There is no direct shortcode available to get the loop items global position with the pagination, but there is a workaround:
1. Please wrap your [wpv-pager-current-page] shortcode in the "Search and Pagination" section, into a span tag with a special id "current-page-number":
<span id="current-page-number">[wpv-pager-current-page]</span>
2. In the "JS editor" tab below that "Search and Pagination" section, add following script:
$( document ).ready(function() {
var pgNumber = $( "#current-page-number" ).text();
if (pgNumber > 1) {
pgNumber = pgNumber - 1;
var pgNumberNew = pgNumber + "1";
$("ol.wpv-loop.js-wpv-loop").attr("start",pgNumberNew);
}
});
The above script will get the current page number and add a "start" attribute to the ordered list, to make it start from the relevant number, on each paginated result.
I hope this helps.
regards,
Waqar
Hey!
Great - I should have thought of that brilliant solution myself 🙂
Cheers and thanks!
Ido