跳到内容

Module Pager

v1.7.0

yama-dev · 2022年9月2日 上架

Create customizable pagination by editing HTML templates in the WordPress admin screen.

正在使用
10+
评分
暂无
累计下载
1,541
最近更新
2026年7月30日
需要 WordPress 5.8+已测试到 7.0.9PHP 7.2+

贡献者

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.

Features

  • Edit pagination HTML from the WordPress admin screen.
  • Start with default templates that work immediately after activation.
  • Configure the previous and next links separately.
  • Use Mustache syntax to render page numbers and conditional states.
  • Restrict the HTML elements and attributes that can be saved.
  • Render pagination with a shortcode or from a theme’s PHP template.

Shortcode

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"]

PHP API

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.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums