Àpèjúwe
Module Pager displays pagination that can be adapted to your siteÌtumọ̀ Yorùbá: ’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Ìtumọ̀ Yorùbá: ’s PHP template.
Shortcode
Add the shortcode where the main queryÌtumọ̀ Yorùbá: ’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.
Ìgbéwọlẹ̀
- Open Plugins > Add New Plugin in the WordPress admin screen.
- Search for “Module Pager” and install it.
- Activate the plugin.
- Review the default templates under Pagination Settings.
- Add the shortcode or PHP call where pagination should appear.
To install a ZIP file, use Upload Plugin on the Add Plugins screen.
FAQ
-
Why is the pagination not displayed?
-
Confirm that the target query contains enough posts to produce multiple pages.
The plugin does not output pagination for a single-page query.
-
Can the templates be restored to their defaults?
-
Select “Reset to defaults” on the Pagination Settings screen, and then save the settings.
-
Can I use a custom WP_Query?
-
Pass the
WP_Queryobject as the first argument of the PHP APIÌtumọ̀ Yorùbá: ’srender()method.The shortcode uses the WordPress main query.
Àwọn àgbéyẹ̀wò
Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.
Àwọn Olùkópa & Olùgbéejáde
“Module Pager” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa sí plugin yìí.
Àwọn OlùkópaTúmọ̀ “Module Pager” sí èdè rẹ.
Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?
Ṣàwárí koodu, ṣàyẹ̀wò ibi ìpamọ́ SVN, tàbí ṣe àgbékalẹ̀ sí àkọsílẹ̀ ìdàgbàsókè nípasẹ̀ RSS.
Àkọsílẹ̀ àwọn àyípadà
1.7.0
- Updated Mustache to version 3.
- Added test environments for WordPress 7.0 and PHP 8.5.
- Added automated tests for PHP 7.4 and PHP 8.5.
- Fixed the shortcode to return its rendered HTML correctly.
- Improved handling when the query string is unavailable or posts per page is zero.
- Fixed line break preservation and default restoration on the Pagination Settings screen.
- Registered default templates during plugin activation and added safe fallbacks for missing settings.
- Improved JavaScript escaping for templates displayed in the admin screen.
- Improved input validation and output escaping for Plugin Check compatibility.