Module Pager displays pagination that can be adapted to your site’s design.
The Pagination Settings screen lets you edit separate HTML templates for the complete pager, previous link, next link, and page numbers.
Add the shortcode where the main query’s pagination should appear.
[wp-module-pager]
Use base_path to specify the base path for pagination URLs.
[wp-module-pager base_path="news"]
Use post_type when the post type needs to be specified explicitly.
[wp-module-pager post_type="news" base_path="news"]
The following example renders pagination for the current main query from a theme template.
<?php
$pager = new Wp_Module_Pager();
$pager->render();
A custom WP_Query object, post type, and base path can also be passed to render().
<?php
$pager = new Wp_Module_Pager();
$pager->render( $custom_query, 'news', 'news' );
No pagination is rendered when the query has only one page.