Skip to:
Content
Pages
Categories
Search
Top
Bottom

Edit Pagination Range

  • @armyadarkness

    Participant

    I can’t believe that I’m the first to ask this… but after 4 days of searching for an answer, and not finding ANYONE with the same question…

    How do I alter the pagination range?

    In my forum, the topics have several hundred pages, and it’s not uncommon to get ten new pages a day. However, the pagination ONLY displays the first three or four (which are absolutely useless) and the last three or four of them (which is completely inadequate).

    So if a member visits the forum after two days of inactivity, they might have 20 pages to catch up on, and since only the last three are displayed, it requires them to click back, reload, click back, reload, click back, reload… 15 times!

    If I could display the last 10 pages, instead of only the last 3 or 4, it would be so much easier.

Viewing 17 replies - 1 through 17 (of 17 total)
  • @robin-w

    Moderator

    I can’t remember it ever being asked 🙂

    However after a bit of digging, this will change it

    add_filter( 'bbp_topic_pagination', 'rew_change_shown' ) ;
    
    function rew_change_shown ($args) {
    	$args['mid_size'] = 8 ;
    return $args ;
    }

    8 shows ‘8 +previous and next’ – so 10 – amend the number to whatever you want

    Put this in your child theme’s function file – or use

    Code Snippets

    @armyadarkness

    Participant

    Thanks a lot Robin, unfortunately, the code didn’t work at all. I copied and pasted it exactly, and even tried that plugin. It just gives errors.

    @armyadarkness

    Participant

    I tried to upload a screen shot, but I see no means to do so.

    @robin-w

    Moderator

    when you say it gives errors – can you say exactly what these are?

    @armyadarkness

    Participant

    Yes, when I copy that code into the Additional CSS panel, all of those “Red X” appear “unexpected characters on line… ” etc.

    @armyadarkness

    Participant

    Why can’t I upload screen shots here?

    @robin-w

    Moderator

    Additional CSS panel

    ah, this is not css, this is php code, it needs to go in the functions file of your child theme or the code snippets plugin. If it is the latter, that should also give you what then error is – I need to know what that say if it doesn’t work

    @armyadarkness

    Participant

    Got it. thanks for clearing that up.

    I saw no means to edit the child theme (nor do I know what that is), and the plugin had no “PHP” entry available. It allows CSS, Java, HTML, and Snippets by Name.

    @robin-w

    Moderator

    you want ‘snippets’ that is the php code bit

    @armyadarkness

    Participant

    I figured that, so I added it, but it made no difference in the pagination. I tried to edit it several ways and it made no visible difference.

    What I’d like is for the forum topic pagination to display the last 10 pages. Right now, It display 1,2,3…722,723,724

    @robin-w

    Moderator

    Right now, It display 1,2,3…722,723,724

    so is this EXACTLY what it displayed without the code ?

    @armyadarkness

    Participant

    Yes… and with it as well. Of course, the last three numbers change as new pages are added.

    @robin-w

    Moderator

    hmmm….not sure I can help without visiting the site – is it private ?

    @armyadarkness

    Participant

    The forum is private, but the site is not. I will happily register you so that you can view the forum if you like.

    @robin-w

    Moderator

    ok, the code I gave you was topics in a forum, not replies in a topic.

    try this instead

    add_filter( 'bbp_replies_pagination', 'rew_change_shown' ) ;
    
    function rew_change_shown ($args) {
    	$args['mid_size'] = 8 ;
    return $args ;
    }

    @armyadarkness

    Participant

    Yay! That worked awesome, and more importantly, I gained some more knowledge to help me build better! Thanks for all of your help.

    I definitely see a difference between topics, replies, and other pages… So I guess I’ll have some experimenting to do. Thanks!

    @robin-w

    Moderator

    great – glad you are fixed, I learnt some stuff as well about how wordpress does pagination, so win-win !!

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