Linux 软件免费装
Banner图

Paginate

开发者 ivan82
更新时间 2013年8月1日 17:19
PHP版本: 2.5.1 及以上
WordPress版本: 3.5.2

标签

page photos pages images list files users pagination lists profiles paginate

下载

详情介绍:

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

安装:

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(); ?>`