{"id":174,"date":"2006-01-03T07:45:56","date_gmt":"2006-01-03T07:45:56","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-pagenavi\/"},"modified":"2024-12-19T01:02:17","modified_gmt":"2024-12-19T01:02:17","slug":"wp-pagenavi","status":"publish","type":"plugin","link":"https:\/\/ceb.wordpress.org\/plugins\/wp-pagenavi\/","author":259,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2.94.5","stable_tag":"2.94.5","tested":"6.7.5","requires":"4.6","requires_php":"","requires_plugins":null,"header_name":"WP-PageNavi","header_author":"Lester 'GaMerZ' Chan","header_description":"","assets_banners_color":"e9eaec","last_updated":"2024-12-19 01:02:17","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/lesterchan.net\/site\/donation\/","header_plugin_uri":"https:\/\/lesterchan.net\/portfolio\/programming\/php\/","header_author_uri":"https:\/\/lesterchan.net","rating":4.7,"author_block_rating":0,"active_installs":500000,"downloads":13324086,"num_ratings":149,"support_threads":1,"support_threads_resolved":0,"author_block_count":0,"sections":["description","faq","changelog"],"tags":{"1.00":{"tag":"1.00","author":"GamerZ","date":"2007-03-20 16:57:17"},"2.00":{"tag":"2.00","author":"GamerZ","date":"2007-03-20 16:57:17"},"2.01":{"tag":"2.01","author":"GamerZ","date":"2007-03-20 16:57:17"},"2.02":{"tag":"2.02","author":"GamerZ","date":"2007-03-20 16:57:17"},"2.03":{"tag":"2.03","author":"GamerZ","date":"2007-03-20 16:57:17"},"2.10":{"tag":"2.10","author":"GamerZ","date":"2007-03-20 16:57:17"},"2.11":{"tag":"2.11","author":"GamerZ","date":"2007-06-02 10:54:50"},"2.20":{"tag":"2.20","author":"GamerZ","date":"2007-09-30 08:16:45"},"2.30":{"tag":"2.30","author":"GamerZ","date":"2008-06-10 07:27:11"},"2.31":{"tag":"2.31","author":"GamerZ","date":"2008-07-20 09:18:12"},"2.40":{"tag":"2.40","author":"GamerZ","date":"2009-02-07 14:08:55"},"2.50":{"tag":"2.50","author":"GamerZ","date":"2009-08-25 19:35:31"},"2.61":{"tag":"2.61","author":"scribu","date":"2010-03-11 09:18:15"},"2.72":{"tag":"2.72","author":"scribu","date":"2010-09-12 18:09:25"},"2.73":{"tag":"2.73","author":"scribu","date":"2010-12-14 08:20:28"},"2.74":{"tag":"2.74","author":"scribu","date":"2011-09-06 15:25:51"},"2.80":{"tag":"2.80","author":"scribu","date":"2011-10-30 11:07:49"},"2.81":{"tag":"2.81","author":"scribu","date":"2011-11-17 12:14:37"},"2.82":{"tag":"2.82","author":"scribu","date":"2012-04-18 23:42:50"},"2.83":{"tag":"2.83","author":"scribu","date":"2013-03-11 12:39:00"},"2.85":{"tag":"2.85","author":"GamerZ","date":"2014-06-25 00:56:33"},"2.86":{"tag":"2.86","author":"GamerZ","date":"2014-09-05 14:16:34"},"2.87":{"tag":"2.87","author":"GamerZ","date":"2015-04-21 10:36:40"},"2.88":{"tag":"2.88","author":"GamerZ","date":"2015-08-13 02:06:13"},"2.89":{"tag":"2.89","author":"GamerZ","date":"2015-11-24 02:14:31"},"2.89.1":{"tag":"2.89.1","author":"GamerZ","date":"2015-11-24 10:05:15"},"2.90":{"tag":"2.90","author":"GamerZ","date":"2016-04-14 05:57:22"},"2.91":{"tag":"2.91","author":"GamerZ","date":"2017-03-31 02:37:04"},"2.92":{"tag":"2.92","author":"GamerZ","date":"2017-06-30 08:12:25"},"2.93":{"tag":"2.93","author":"GamerZ","date":"2018-12-19 04:49:51"},"2.93.1":{"tag":"2.93.1","author":"GamerZ","date":"2019-10-23 03:26:38"},"2.93.2":{"tag":"2.93.2","author":"GamerZ","date":"2020-03-26 02:17:13"},"2.93.3":{"tag":"2.93.3","author":"GamerZ","date":"2020-03-29 04:29:21"},"2.93.4":{"tag":"2.93.4","author":"GamerZ","date":"2021-02-22 06:14:30"},"2.94.0":{"tag":"2.94.0","author":"GamerZ","date":"2023-04-27 01:28:56"},"2.94.1":{"tag":"2.94.1","author":"GamerZ","date":"2023-08-09 02:53:59"},"2.94.2":{"tag":"2.94.2","author":"GamerZ","date":"2024-11-16 01:30:31"},"2.94.3":{"tag":"2.94.3","author":"GamerZ","date":"2024-11-24 13:55:04"},"2.94.4":{"tag":"2.94.4","author":"GamerZ","date":"2024-12-16 03:25:03"},"2.94.5":{"tag":"2.94.5","author":"GamerZ","date":"2024-12-19 01:02:17"}},"upgrade_notice":[],"ratings":{"1":9,"2":0,"3":2,"4":11,"5":127},"assets_icons":{"icon.svg":{"filename":"icon.svg","revision":977997,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":1206758,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":1206758,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.00","2.00","2.01","2.02","2.03","2.10","2.11","2.20","2.30","2.31","2.40","2.50","2.61","2.72","2.73","2.74","2.80","2.81","2.82","2.83","2.85","2.86","2.87","2.88","2.89","2.89.1","2.90","2.91","2.92","2.93","2.93.1","2.93.2","2.93.3","2.93.4","2.94.0","2.94.1","2.94.2","2.94.3","2.94.4","2.94.5"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":1206758,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":1206758,"resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"With Custom Styling","2":"Admin - Options Page"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1753,243,900,5826],"plugin_category":[43],"plugin_contributors":[77620,77621],"plugin_business_model":[],"class_list":["post-174","plugin","type-plugin","status-publish","hentry","plugin_tags-navigation","plugin_tags-pages","plugin_tags-pagination","plugin_tags-paging","plugin_category-customization","plugin_contributors-gamerz","plugin_contributors-scribu","plugin_committers-gamerz","plugin_committers-scribu"],"banners":{"banner":"https:\/\/ps.w.org\/wp-pagenavi\/assets\/banner-772x250.jpg?rev=1206758","banner_2x":"https:\/\/ps.w.org\/wp-pagenavi\/assets\/banner-1544x500.jpg?rev=1206758","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/wp-pagenavi\/assets\/icon.svg?rev=977997","icon":"https:\/\/ps.w.org\/wp-pagenavi\/assets\/icon.svg?rev=977997","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-pagenavi\/assets\/screenshot-1.png?rev=1206758","caption":"With Custom Styling"},{"src":"https:\/\/ps.w.org\/wp-pagenavi\/assets\/screenshot-2.png?rev=1206758","caption":"Admin - Options Page"}],"raw_content":"<!--section=description-->\n<p>Want to replace the old <em>&larr; Older posts | Newer posts &rarr;<\/em> links with some page links?<\/p>\n\n<p>This plugin provides the <code>wp_pagenavi()<\/code> template tag which generates fancy pagination links.<\/p>\n\n<h3>Usage<\/h3>\n\n<p>In your theme, you need to find calls to next_posts_link() and previous_posts_link() and replace them.<\/p>\n\n<p>In the Twentyten theme, it looks like this:<\/p>\n\n<pre><code>&lt;div class=\"nav-previous\"&gt;&lt;?php next_posts_link( __( '&lt;span class=\"meta-nav\"&gt;&amp;larr;&lt;\/span&gt; Older posts', 'twentyten' ) ); ?&gt;&lt;\/div&gt;\n&lt;div class=\"nav-next\"&gt;&lt;?php previous_posts_link( __( 'Newer posts &lt;span class=\"meta-nav\"&gt;&amp;rarr;&lt;\/span&gt;', 'twentyten' ) ); ?&gt;&lt;\/div&gt;\n<\/code><\/pre>\n\n<p>You would replace those two lines with this:<\/p>\n\n<pre><code>&lt;?php wp_pagenavi(); ?&gt;\n<\/code><\/pre>\n\n<p>For multipart pages, you would look for code like this:<\/p>\n\n<pre><code>&lt;?php wp_link_pages( ... ); ?&gt;\n<\/code><\/pre>\n\n<p>and replace it with this:<\/p>\n\n<pre><code>&lt;?php wp_pagenavi( array( 'type' =&gt; 'multipart' ) ); ?&gt;\n<\/code><\/pre>\n\n<p>Go to <em>WP-Admin -&gt; Settings -&gt; PageNavi<\/em> for configuration.<\/p>\n\n<h3>Changing the CSS<\/h3>\n\n<p>If you need to configure the CSS style of WP-PageNavi, you can copy the <code>pagenavi-css.css<\/code> file from the plugin directory to your theme's directory and make your modifications there. This way, you won't lose your changes when you update the plugin.<\/p>\n\n<p>Alternatively, you can uncheck the \"Use pagenavi.css?\" option from the settings page and add the styles to your theme's style.css file directly.<\/p>\n\n<h3>Changing Class Names<\/h3>\n\n<p>There are <a href=\"http:\/\/codex.wordpress.org\/Glossary#Filter\">filters<\/a> that can be used to change the default class names that are assigned to page navigation elements.<\/p>\n\n<h4>Filters<\/h4>\n\n<ul>\n<li><code>wp_pagenavi_class_pages<\/code><\/li>\n<li><code>wp_pagenavi_class_first<\/code><\/li>\n<li><code>wp_pagenavi_class_previouspostslink<\/code><\/li>\n<li><code>wp_pagenavi_class_extend<\/code><\/li>\n<li><code>wp_pagenavi_class_smaller<\/code><\/li>\n<li><code>wp_pagenavi_class_page<\/code><\/li>\n<li><code>wp_pagenavi_class_current<\/code><\/li>\n<li><code>wp_pagenavi_class_larger<\/code><\/li>\n<li><code>wp_pagenavi_class_nextpostslink<\/code><\/li>\n<li><code>wp_pagenavi_class_last<\/code><\/li>\n<\/ul>\n\n<h4>Filter Usage<\/h4>\n\n<pre><code>\/\/ Simple Usage - 1 callback per filter\nadd_filter('wp_pagenavi_class_previouspostslink', 'theme_pagination_previouspostslink_class');\nadd_filter('wp_pagenavi_class_nextpostslink', 'theme_pagination_nextpostslink_class');\nadd_filter('wp_pagenavi_class_page', 'theme_pagination_page_class');\n\nfunction theme_pagination_previouspostslink_class($class_name) {\n  return 'pagination__control-link pagination__control-link--previous';\n}\n\nfunction theme_pagination_nextpostslink_class($class_name) {\n  return 'pagination__control-link pagination__control-link--next';\n}\n\nfunction theme_pagination_page_class($class_name) {\n  return 'pagination__current-page';\n}\n\n\n\/\/ More Concise Usage - 1 callback for all filters\nadd_filter('wp_pagenavi_class_previouspostslink', 'theme_pagination_class');\nadd_filter('wp_pagenavi_class_nextpostslink', 'theme_pagination_class');\nadd_filter('wp_pagenavi_class_page', 'theme_pagination_class');\n\nfunction theme_pagination_class($class_name) {\n  switch($class_name) {\n    case 'previouspostslink':\n      $class_name = 'pagination__control-link pagination__control-link--previous';\n      break;\n    case 'nextpostslink':\n      $class_name = 'pagination__control-link pagination__control-link--next';\n      break;\n    case 'page':\n      $class_name = 'pagination__current'\n      break;\n  }\n  return $class_name;\n}\n<\/code><\/pre>\n\n<h3>Development<\/h3>\n\n<ul>\n<li><a href=\"https:\/\/github.com\/lesterchan\/wp-pagenavi\" title=\"https:\/\/github.com\/lesterchan\/wp-pagenavi\">https:\/\/github.com\/lesterchan\/wp-pagenavi<\/a><\/li>\n<\/ul>\n\n<h3>Credits<\/h3>\n\n<ul>\n<li>Plugin icon by <a href=\"http:\/\/www.simpleicon.com\">SimpleIcon<\/a> from <a href=\"http:\/\/www.flaticon.com\">Flaticon<\/a><\/li>\n<\/ul>\n\n<h3>Donations<\/h3>\n\n<p>I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id='error%20on%20activation%3A%20%22parse%20error%3A%20syntax%20error%2C%20unexpected...%22'><h3>Error on activation: \"Parse error: syntax error, unexpected...\"<\/h3><\/dt>\n<dd><p>Make sure your host is running PHP 5. The only foolproof way to do this is to add this line to wp-config.php (after the opening <code>&lt;?php<\/code> tag):<\/p>\n\n<pre><code>var_dump(PHP_VERSION);\n<\/code><\/pre>\n\n<p><br \/><\/p><\/dd>\n<dt id='when%20i%20go%20to%20page%202%2C%20i%20see%20the%20same%20posts%20as%20on%20page%201%21'><h3>When I go to page 2, I see the same posts as on page 1!<\/h3><\/dt>\n<dd><p>You're using <code>query_posts()<\/code> wrong. See <a href=\"http:\/\/scribu.net\/wordpress\/wp-pagenavi\/right-way-to-use-query_posts.html\">The Right Way To use query_posts()<\/a><\/p><\/dd>\n<dt id='does%20pagenavi%20work%20with%20secondary%20wp_query%20instances%3F'><h3>Does PageNavi work with secondary WP_Query instances?<\/h3><\/dt>\n<dd><p>Yes; read <a href=\"http:\/\/scribu.net\/wordpress\/wp-pagenavi\/wpn-2-74.html\">this tutorial<\/a><\/p><\/dd>\n<dt id='how%20do%20i%20ignore%20the%20options%20page%3F'><h3>How do I ignore the options page?<\/h3><\/dt>\n<dd><p>If you are running a multi-language plugin, you will probably want to ignore the strings in the options page.<\/p>\n\n<p>You can do that like so:<\/p>\n\n<pre><code>&lt;?php wp_pagenavi( array( 'options' =&gt; PageNavi_Core::$options-&gt;get_defaults() ) ); ?&gt;\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h3>2.94.5<\/h3>\n\n<ul>\n<li>FIXED: WP SCB Framework now uses init hook again<\/li>\n<\/ul>\n\n<h3>2.94.4<\/h3>\n\n<ul>\n<li>FIXED: Revert WP SCB Framework to use plugins_loaded hook<\/li>\n<\/ul>\n\n<h3>2.94.3<\/h3>\n\n<ul>\n<li>FIXED: Update WP SCB Framework to fix load_textdomain_just_in_time warning<\/li>\n<li>FIXED: Remove load_plugin_textdomain since it is no longer needed since WP 4.6<\/li>\n<\/ul>\n\n<h3>2.94.2<\/h3>\n\n<ul>\n<li>FIXED: load_plugin_textdomain to be called during init<\/li>\n<\/ul>\n\n<h3>2.94.1<\/h3>\n\n<ul>\n<li>FIXED: PHP 8.2 warnings<\/li>\n<\/ul>\n\n<h3>2.94.0<\/h3>\n\n<ul>\n<li>NEW: Add args param on wp_pagenavi filter. Props @asadowski10<\/li>\n<li>NEW: Improve accessibility of nav links. Props @carlabobak<\/li>\n<\/ul>\n\n<h3>2.93.4<\/h3>\n\n<ul>\n<li>FIXED: Update SCB Framework To Support PHP 8<\/li>\n<\/ul>\n\n<h3>2.93.3<\/h3>\n\n<ul>\n<li>FIXED: Update SCB Framework To Remove contextual_help<\/li>\n<\/ul>\n\n<h3>2.93.2<\/h3>\n\n<ul>\n<li>NEW: Bumped to WordPress 5.4<\/li>\n<li>FIXED: Ensure Action Links is always an array<\/li>\n<\/ul>\n\n<h3>2.93.1<\/h3>\n\n<ul>\n<li>FIXED: Duplicated Settings Saved admin_notices<\/li>\n<\/ul>\n\n<h3>2.93<\/h3>\n\n<ul>\n<li>Remove screen_icon from SCB.<\/li>\n<\/ul>\n\n<h3>2.92<\/h3>\n\n<ul>\n<li>Add title attr to pages link. Props @Mahjouba91.<\/li>\n<\/ul>\n\n<h3>2.91<\/h3>\n\n<ul>\n<li>Validate text option against kses <\/li>\n<li>Update SCB Framework<\/li>\n<\/ul>\n\n<h3>2.90<\/h3>\n\n<ul>\n<li>Remove po\/mo files from the plugin<\/li>\n<li>Use translate.wordpress.org to translate the plugin<\/li>\n<\/ul>\n\n<h3>2.89.1<\/h3>\n\n<ul>\n<li>FIXED: before and after args<\/li>\n<\/ul>\n\n<h3>2.89<\/h3>\n\n<ul>\n<li>NEW: wrapper_tag option to allow other HTML tag besides DIV and wrapper_class option to allow other class name besides wp-pagenavi. Props @Mahjouba91.<\/li>\n<\/ul>\n\n<h3>2.88<\/h3>\n\n<ul>\n<li>NEW: Added filters for altering class names. Props @bookwyrm<\/li>\n<\/ul>\n\n<h3>2.87<\/h3>\n\n<ul>\n<li>NEW: Uses WordPress native uninstall.php<\/li>\n<\/ul>\n\n<h3>2.86<\/h3>\n\n<ul>\n<li>NEW: Bump to 4.0<\/li>\n<li>NEW: Added rel=next and rel=previous<\/li>\n<\/ul>\n\n<h3>2.85<\/h3>\n\n<ul>\n<li>FIXED: \"Use pagenavi-css.css\" &amp; \"Always Show Page Navigation\" in the options are not being saved<\/li>\n<\/ul>\n\n<h3>2.84<\/h3>\n\n<ul>\n<li>FIXED: Updated scb framework to fix scbAdminPage incompatible error<\/li>\n<\/ul>\n\n<h3>2.83<\/h3>\n\n<ul>\n<li>added 'echo' parameter<\/li>\n<li>added Estonian and Bengali translations<\/li>\n<li>updated scbFramework<\/li>\n<\/ul>\n\n<h3>2.82<\/h3>\n\n<ul>\n<li>fixed prev\/next links not appearing in some conditions<\/li>\n<li>added Hebrew, Georgian and Azerbaijani translations<\/li>\n<li>updated scbFramework<\/li>\n<\/ul>\n\n<h3>2.81<\/h3>\n\n<ul>\n<li>require an explicit type; fixes bugs with multipart pages<\/li>\n<\/ul>\n\n<h3>2.80<\/h3>\n\n<ul>\n<li>support for multi-part pages and user queries<\/li>\n<li>moved prev\/next links before\/after first\/last links<\/li>\n<li><a href=\"http:\/\/scribu.net\/wordpress\/wp-pagenavi\/wpn-2-80.html\">more info<\/a><\/li>\n<\/ul>\n\n<h3>2.74 (2011-02-17)<\/h3>\n\n<ul>\n<li>added 'smaller' and 'larger' classes<\/li>\n<li>added $query arg to wp_pagenavi()<\/li>\n<li>updated translations<\/li>\n<li><a href=\"http:\/\/scribu.net\/wordpress\/wp-pagenavi\/wpn-2-74.html\">more info<\/a><\/li>\n<\/ul>","raw_excerpt":"Adds a more advanced paging navigation interface.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=174"}],"author":[{"embeddable":true,"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/gamerz"}],"wp:attachment":[{"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=174"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=174"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=174"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=174"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=174"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ceb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}