Skip to content
themeforge
EN
Start free
Menu
  1. Home
  2. Attribute reference
  3. wp-paginate
Core Blog and posts

Page numbers under a list of posts

wp-paginate="mid_size=1"

When there are more posts than fit on a page, these attributes print the numbers and the “newer / older” links.

Where it goes

Under the blog, a category archive or the search results: an empty block with wp-paginate.

Under your own wp-query list: wp-paginate-query on a block after the list, not inside it.

Settings in the value: mid_size=1 (numbers around the current one), prev_text=Newer&next_text=Older.

Example: news pages

Markup index.html
<div class="news" wp-query="'post_type'=>'post','posts_per_page'=>6">
  <article class="news-card">
    <h3 wp="post-title">New autumn menu</h3>
  </article>
</div>
<div class="pagination"
     wp-paginate-query="prev_text=Newer&next_text=Older"></div>
In the admin Posts
Posts
  • New autumn menu
  • Filter of the day is back
  • Open on Sundays
  • … 14 posts
On the site the news page
News
New autumn menu
Filter of the day is back
Newer 1 2 3 Older

What matters

  • How many posts make a page: posts_per_page of the query, or Settings → Reading for the blog.
  • Put the attribute on an empty block: WordPress prints the links itself.

Common mistakes

The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.

Not like this
<div class="news" wp-query="'post_type'=>'post','posts_per_page'=>6">
  <article><h3 wp="post-title">New autumn menu</h3></article>
</div>
<div class="pagination" wp-paginate="mid_size=1"></div>

Under your own list wp-paginate counts the pages of the blog, not of the list: the numbers are wrong or missing, and the log is silent.

Like this
<div class="news" wp-query="'post_type'=>'post','posts_per_page'=>6">
  <article><h3 wp="post-title">New autumn menu</h3></article>
</div>
<div class="pagination" wp-paginate-query="mid_size=1"></div>

wp-paginate-query after the list.

Alternative spelling

wp_paginate works the same: the build gives an identical theme.

Used in recipes

Ready when you are

See your site’s WordPress admin before you pay.