2017 © Pedro Peláez
 

library wp-pagination

WordPress Pagination component for Palmtree PHP

image

palmtree/wp-pagination

WordPress Pagination component for Palmtree PHP

  • Wednesday, November 1, 2017
  • by palmtree
  • Repository
  • 1 Watchers
  • 1 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

Palmtree WordPress Pagination

WordPress pagination component for Palmtree PHP, (*1)

Generates pagination for the main WP_Query or any query provided and outputs with Bootstrap v4 classes., (*2)

Requirements

  • PHP >= 7.1

Installation

Use composer to add the package to your dependencies:, (*3)

composer require palmtree/wp-pagination

Usage

Basic

<?php
$pagination = new \Palmtree\WordPress\Pagination\Pagination();

// Get Bootstrap formatted pagination
echo $pagination->getHtml();

// __toString() is also implemented, which implicitly calls getHtml()
echo $pagination;

// Or get an array of unstyled links
$links = $pagination->getLinks();

Advanced

<?php
use Palmtree\WordPress\Pagination\Pagination;

$query = new \WP_Query();

$pagination = new Pagination();
$pagination->setQuery($query);
$pagination
    ->addArg('prev_text', 'Previous')
    ->addArg('next_text', 'Next');

License

Released under the MIT license, (*4)

The Versions

01/11 2017

dev-master

9999999-dev

WordPress Pagination component for Palmtree PHP

  Sources   Download

MIT

01/11 2017

v0.2.0

0.2.0.0

WordPress Pagination component for Palmtree PHP

  Sources   Download

MIT

01/11 2017

v0.1.0

0.1.0.0

WordPress Pagination component for Palmtree PHP

  Sources   Download

MIT