An open API service indexing awesome lists of open source software.

https://github.com/palmtreephp/wp-pagination

:palm_tree: WordPress pagination component for Palmtree PHP
https://github.com/palmtreephp/wp-pagination

bootstrap composer-package pagination php wordpress wordpress-pagination-component

Last synced: 11 months ago
JSON representation

:palm_tree: WordPress pagination component for Palmtree PHP

Awesome Lists containing this project

README

          

# Palmtree WordPress Pagination

WordPress pagination component for Palmtree PHP

Generates pagination for the main WP_Query or any query provided and outputs with Bootstrap v4 classes.

## Requirements
* PHP >= 7.1

## Installation

Use composer to add the package to your dependencies:
```bash
composer require palmtree/wp-pagination
```

## Usage

#### Basic
```php
getHtml();

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

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

```

#### Advanced

```php
setQuery($query);
$pagination
->addArg('prev_text', 'Previous')
->addArg('next_text', 'Next');
```

## License

Released under the [MIT license](LICENSE)