Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom Forum Pagination


  • alastair123
    Participant

    @alastair123

    Hi Guys,
    I’ve taken it upon myself to try and create my own customised forum – I’ve got it mostly working how I’d like, but I’ve hit a brick wall in trying to easily customise how the pagination should look for the lists of topics and also replies.

    I can see where this is being generated in the bbpress plugin PHP code, but ideally I would leave that alone as my changes could disappear on a plugin upgrade.

    I tried following a useful tutorial I found on WPUP, but it didn’t generate any pagination at all – perhaps I am on a different plugin version or something.

    Any advice on how to go about this would be really appreciated!

Viewing 8 replies - 1 through 8 (of 8 total)

  • Robin W
    Moderator

    @robin-w

    ok, can you define what you mean by ‘customisation’? do you mean style, or say entries per page or what ?


    alastair123
    Participant

    @alastair123

    Sure!

    I’d really like to just be able to access the raw data so that I can style it myself with say Bootstrap + custom CSS.

    e.g.

    “Posts: 25 [showing 11 to 19]”
    “<- 1 2 ->”

    So I would need the total replies for the current topic, current page, etc. And I would need to create the necessary links to then show the next / prev set of posts (or topics).


    Robin W
    Moderator

    @robin-w

    ok, to save me searching where is ‘I can see where this is being generated in the bbpress plugin PHP code’


    alastair123
    Participant

    @alastair123

    It looks like the default pagination details are being generated like this:

    plugins -> bbpress -> templates -> default -> bbpress -> pagination-topics.php

    Inside this module are these calls which go into the plugin:

    bbp_forum_pagination_count()
    bbp_forum_pagination_links()

    These are both defined in:

    plugins -> bbpress -> includes -> topics -> template.php


    Robin W
    Moderator

    @robin-w

    both those functions have filters, so you could quite happily amend them using a filter, which would then not be affected by plugin updates


    alastair123
    Participant

    @alastair123

    Oh, excellent – that’s perfect, I’ll look into doing it that way – thanks very much for taking the time to answer!


    Robin W
    Moderator

    @robin-w

    🙂


    alastair123
    Participant

    @alastair123

    I managed to get the page counts how I want using a filter – however, for the pagination links, this looked a bit beyond me, so I resorted to hacking the generated HTML in Javascript to create the markup I wanted … and it looks pretty good now.

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