Paging hack (2 posts)

  1. Dystopia777
    Posted 8 years ago #


    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!!

  2. Kafkaesqui

    Posted 8 years ago #

    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:


    Along with that, the 'posts per page' value is available through:


Topic Closed

This topic has been closed to new replies.

About this Topic