The [vista_listings_paginator]
shortcode generates a pagination button that can paginate a [vista_listings_list]
shortcode on the current page. This button will not function on a page which doesn't contain the [vista_listings_list]
shortcode. This shortcode accepts one required attribute:
type - Must be set to either "forward" or "backward". Determines which direction the button paginates. Generally, you'll want to use this shortcode twice on each page to have both a forward and backward button.
The button output has the following classes, which you can use to customize styling for the paginator buttons:
vista-listings-paginator
- Base class applied to all paginator buttonslistings-forward
- Applied only to forward ("next page") buttonslistings-backward
- Applied only to backward ("previous page") buttons
The text content of the button comes from the text between the opening and closing shortcode tags. For example:
[vista_listings_paginator type="forward"]Next Page[/vista_listings_paginator]
Will create a button with the text "Next Page", which links to the next 20 listings.
Pagination works by updating the offset
and limit
URL parameters. The limit
specifies the maximum number of listings to display per page. This is preserved between paginations. The offset
is incremented by limit
on each click to show the next page of listings.