Skip to:
Content
Pages
Categories
Search
Top
Bottom

Vary Pagination Limits per Forum

  • @lmstearn

    Participant

    Forums containing chit-chat/banter might want twice as many topics per page than those containing lengthy dissertations, might make more sense with categories, or at least categorised settings.
    Thanks.

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

    Moderator

    untested, but this should work

    add_filter( 'bbp_get_topics_per_page', 'rew_amend_topics', 10 , 2) ;
    
    function rew_amend_topics ($retval, $default ) {
    	$forum = bbp_get_forum_id() ;
    	if ($forum == 123) $retval = 10 ;
    	if ($forum == 456) $retval = 5 ;
    return $retval ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    @lmstearn

    Participant

    @robin-w, thank you for the code and idea, will try it out. 🙂

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