# How to use pagination

To add pagination to a list, place the `[nav]` shortcode inside your list template. By default it displays previous and next page links. It accepts two attributes:

- `type` — how W4 Post List renders the pagination markup: 
    - `type="plain"` — outputs plain `<a>` tags with nothing around them.
    - `type="list"` — wraps the pagination in a `<ul> > <li>` list.
- `ajax` — set `ajax=1` to load pages without reloading. AJAX fetches the next page’s content and replaces the current content. Leave it off and the list paginates with a query variable in the URL instead.

Since version 3.0.0, AJAX pagination is plain JavaScript with no dependencies. Earlier versions used jQuery, which block themes such as Twenty Twenty-Four and Twenty Twenty-Five do not load on the front end — on those themes clicking a page link did nothing. If you are on a block theme and pagination never worked for you, update to 3.0.0.

The query-variable method uses a slightly verbose URL parameter on purpose: it lets multiple lists on the same page paginate independently, without conflicting with one another.

See [the template tags reference](https://w4dev.com/docs/w4-post-list/faqs/what-are-the-available-template-tags/) for the full set of `[nav]` attributes, including `prev_text` and `next_text`.

Source: https://w4dev.com/docs/w4-post-list/how-to-use-pagination/
