Title: Paging hack
Last modified: August 18, 2016

---

# Paging hack

 *  [dystopia777](https://wordpress.org/support/users/dystopia777/)
 * (@dystopia777)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/paging-hack/)
 * Hey,
 * I’m having a go at writing a simple plugin that lists rows from a table in a 
   page available from within the admin area. I have created the table myself.
 * I wanted to know if there was a built in way of paging result sets, 10 per page
   or whatever. I’ve had a look at the wpdb object and the documentation for wp-
   query. As far as I can tell wp-query is for use with pre-existing data structures
   such as a posts?
 * Is there an advisable method or facility within the source code that allows record
   paging for custom sql? or must I hack something together myself?
 * Any help appreciated!!

Viewing 1 replies (of 1 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/paging-hack/#post-661287)
 * Otto gave you an example of how to handle pagination through a custom query in
   your other thread. See here for how you might collect the ‘page’ # you’re presently
   on:
 * [http://wordpress.org/support/topic/57912#post-312858](http://wordpress.org/support/topic/57912#post-312858)
 * Along with that, the ‘posts per page’ value is available through:
 * `get_query_var('posts_per_page')`

Viewing 1 replies (of 1 total)

The topic ‘Paging hack’ is closed to new replies.

## Tags

 * [paging](https://wordpress.org/support/topic-tag/paging/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)
 * [wp-query](https://wordpress.org/support/topic-tag/wp-query/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [18 years, 6 months ago](https://wordpress.org/support/topic/paging-hack/#post-661287)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
