Title: Paginate
Author: ivan82
Published: <strong>2013 年 8 月 1 日</strong>
Last modified: 2013 年 8 月 1 日

---

搜索插件

![](https://ps.w.org/paginate/assets/banner-772x250.png?rev=749151)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/paginate_b8b8b8.svg)

# Paginate

 作者：[ivan82](https://profiles.wordpress.org/ivan82/)

[下载](https://downloads.wordpress.org/plugin/paginate.zip)

 * [详情](https://cn.wordpress.org/plugins/paginate/#description)
 * [评价](https://cn.wordpress.org/plugins/paginate/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/paginate/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/paginate/#developers)

 [支持](https://wordpress.org/support/plugin/paginate/)

## 描述

Display your list with pagination by a simple function call.
 Add multiple paginations
to the same page.

**Features**

 * Multiple paginations at the same page
 * Chose how many items to display per page, default: 10
 * Chose adjacent items, default: 6
 * Customize on page query variable, default: “page”
 * Choose if the on page value should be fetched automatically, default: true
 * How to display first and last page buttons, as numbers or as text, default: numbers
 * All the buttons are visible by default
 * If the previous button is visible
 * If the next button is visible
 * If the previous button is visible when the first page is reached
 * If the next button is visible when the last page is reached
 * If the adjacent dots are visible
 * If the first button is visible
 * If the last button is visible
 * Localization support – download the template and submit your language
 * All HTML/CSS elements are customizable

**Changelog**

 * 1.0: Plug in release

## 安装

_Install and Activate_

 1. Download and unzip `paginate.zip`.
 2. Upload the `paginate` directory to the `/wp-content/plugins/` directory.
 3. Activate the plugin through the `Plugins` menu in WordPress.
 4. In your theme, modify the CSS file to change the look and feel of your pagination.

_Implement_

3 line implementation

    ```
    <?php
    $totalitems = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
    $p = new paginate($totalitems);
    echo $p->get_pagination();
    ?>
    ```

Post onpage argument

    ```
    <?php
    $onPage = $_GET['page']
    $totalitems = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
    $p = new paginate($totalitems);
    echo $p->get_pagination($onPage);
    ?>
    ```

Example implementation

    ```
    <?php
    //get total items from database
    $totalitems = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");

    $p = new paginate($totalitems);
    $limit = $p->itemsPerPage;
    $offset = $p->get_offset();

    //your query. add the offset and limit to the query
    $query = "SELECT $wpdb->users.ID FROM $wpdb->users LIMIT $offset, $limit";
    $user_ids = $wpdb->get_results($query);
    //your loop
    foreach($user_ids as $id) {
      //do something...
    }

    //pagination html
    echo $p->get_pagination();
    ?>
    ```

## 评价

此插件暂无评价。

## 贡献者及开发者

「Paginate」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ ivan82 ](https://profiles.wordpress.org/ivan82/)

[帮助将「Paginate」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/paginate)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/paginate/)，查看[SVN仓库](https://plugins.svn.wordpress.org/paginate/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/paginate/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/paginate/)。

## 额外信息

 *  版本 **1.0**
 *  最后更新：**13 年前**
 *  活跃安装数量 **30+**
 *  WordPress 版本 ** 2.5.1 或更高版本 **
 *  已测试的最高版本为 **3.5.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/paginate/)
 * 标签
 * [list](https://cn.wordpress.org/plugins/tags/list/)[page](https://cn.wordpress.org/plugins/tags/page/)
   [pages](https://cn.wordpress.org/plugins/tags/pages/)[Paginate](https://cn.wordpress.org/plugins/tags/paginate/)
   [pagination](https://cn.wordpress.org/plugins/tags/pagination/)
 *  [高级视图](https://cn.wordpress.org/plugins/paginate/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/paginate/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/paginate/reviews/)

## 贡献者

 *   [ ivan82 ](https://profiles.wordpress.org/ivan82/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/paginate/)