Loop pagination

This is a feature for AJAX pagination of loops.

With the Loop tag, use the paged attribute to define the number of items per page.

<Loop type=post paged=2>

This will create a wrapper element for the pagination script.

Currently, the loop types list and map are not supported.

Buttons

After the loop, use the PaginateButtons tag to display pagination.

<PaginateButtons />

Fields

Optionally, use the PaginateFields tag to display current pagination state.

<PaginateFields>
  Page <Field current_page /> of <Field total_pages />
</PaginateFields>

Available fields are:

  • current_page - Current page
  • total_pages - Total number of pages

The current page will be updated as the user navigates pages.

Example

Here's a full example of loop pagination.

<ul>
  <Loop type=post paged=2>
    <li>
      <a href="{Field url}"><Field title /></a>
    </li>
  </Loop>
</ul>

<PaginateButtons />

<PaginateFields>
  Page <Field current_page /> of <Field total_pages />
</PaginateFields>