Responsive Pagination Wordpress Plugin - Rating, Reviews, Demo & Download

Responsive Pagination Wordpress Plugin - Rating, Reviews, Demo & Download
No ratings yet
Free
Follow for free plugins, new theme releases and theme news

Plugin Description

Responsive Pagination lets you configure your pagination to adapt to different screen size. Your pagination can be shown differently based on viewport width as in responsive web design concept.

For example, you might want to have a longer pagination with many page numbers when your site visitors are using desktops or large screens, but need shorter pagination with only “Prev” and “Next” link when they’re using phones.

Two Different Methods to Apply Responsive Pagination

Convert Existing Pagination

This method will convert the existing pagination from your theme into Responsive Pagination. You only need to fill the selector (CSS or jQuery-like selector) of the existing pagination element in the admin settings page, without adding any WordPress shortcode or PHP code.

Create new Pagination Programmatically

This method will need you to insert PHP code into template files using Responsive Pagination API. This method supports both post-type pagination and custom generic pagination.

Responsive Pagination API

If you’re creating pagination programmatically, this plugin adds a new function for you to use.

<?php create_responsive_pagination( $id, $args ) ?>

Parameters :
* $id: (string) (required) ID for the new pagination you want to create in kebab-case format.
* $args : (WP_Query | array) (required) WP_Query instance, or array of argument.
$current : (int) Current page
$total: (int) Total pages
$urlFirstPage : (string) URL for first page
$urlPattern: (string) URL pattern for this pagination by using {pagenum} tag.

It will render a new pagination where you put the function.

Note : The pagination settings are still configured from within Admin Settings Page.

Example

Creating pagination for posts within main loop. Similar way for custom post type.

<?php
  global $wp_query;   // or some custom WP_Query instance
  if( function_exists( 'create_responsive_pagination' ) ) {
      create_responsive_pagination( 'my-pagination-id', $wp_query );
  }
?>

Creating a more generic pagination by providing your own data for current page, total pages, URL first page, and URL pattern.

<?php
  if( function_exists( 'create_responsive_pagination' ) ) {
      create_responsive_pagination( 'my-pagination-id', array(
        'current'         => $my_current_page,
        'total'           => $my_total_pages,
        'url_first_page'  => 'https://www.example.com/archives/',
        'url_pattern'     => 'https://www.example.com/archives/page/{pagenum}'
      ) );
  }
?>

Screenshots

No screenshots provided


Reviews & Comments