Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to use bbpress pagination in a plugin?

  • Hi,

    I have the data, but how to use it with bbpress’ pagination? Where to put the data?

    I have for excample:

    $mydata = the array with rows from the database that gets displayed

    $mydata_count = total rows counted

    $mydata_pagelimit = total rows that must be shown each page

    Is there any way to hook this into bbpress pagination at all? Or do I have to write one myself?

    Kind regards,

Viewing 1 replies (of 1 total)

  • Ben L.
    Member

    @nightgunner5

    Assuming that $mydata_curpage is the current page number (starting from 1):

    bb_paginate_links( array( 'total' => ceil( $mydata_count / $mydata_pagelimit ), 'current' => $mydata_curpage ) )

    You’ll have to do the actual pagination yourself, but that’s as simple as an array_slice.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar