Skip to:
Content
Pages
Categories
Search
Top
Bottom

Maximum number of subforums? (displayed)

  • @pinkishhue

    Participant

    Just wondering if anyone has come across this before – I’m attempting to create a subforum for every postcode district in the UK of which there are 2000+ (this may seem a bad idea but having considered many different options it seems the best/simplest for my use case at the moment)

    I’ve imported the forums via the ‘WP CSV’ plugin, and they seem to have imported fine, but on the front end when viewing the full forum list it only shows the first 50. Is this by design? Or could it be something buggy I have done?

    If it’s unavoidable I guess I can make them sub-subforums of a smaller number of postcode areas.

    Thanks

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

    Moderator

    the code only shows 50

    put this in your functions file (untested, but should work)

    add_filter ('bbp_before_has_forums_parse_arguments', 'rew_show_all' ) :
    
    function rew_show_all ($args) {
    	$args['posts_per_page'] = -1 ;
    return $args ;
    
    }

    @pinkishhue

    Participant

    Thank you Robin, didn’t work unfortunately. First got the error:

    Parse error: syntax error, unexpected ‘:’ in C:\xampp\htdocs\sitename\wp-content\themes\make-child-theme\functions.php on line 196

    Changed : to ; and the error went away but it didn’t change the subforums list.

    @robin-w

    Moderator

    sorry – I was half awake this morning

    try

    add_filter ('bbp_before_has_forums_parse_args', 'rew_show_all' ) ;
    
    function rew_show_all ($args) {
    	$args['posts_per_page'] = -1 ;
    return $args ;
    
    }

    @pinkishhue

    Participant

    Great, thank you 🙂 That seems to be working when you view the parent forum list (site.com/forums/forum/parent-forum/), but still not when viewing the main forum index.

    Guessing perhaps ‘bbp_before_has_forums_parse_args’ is not used on that list, something else, but I have no idea what (google-fu not getting me anywhere on this one!)

    @pinkishhue

    Participant

    Just thinking, I suppose I don’t actually need all 2000 listed on the forum index! (although would be handy to know how). But will see if I can hide that specific subforum list when viewing the index.

    @pinkishhue

    Participant

    To update again , I think 2000+ subforums is maybe just too much (for a standard server set up). I keep getting “Maximum execution time of 30 seconds exceeded” errors, so I guess…back to the drawing board!

    Thanks anyway for your help Robin.

    @robin-w

    Moderator

    ok, thanks for the updates

    @netweb

    Keymaster

    For sure there will be issues for sure with bbPress and ~2000 forums, it wasn’t designed for this many forums, it’s also more often than not not a good idea to have this many forums.

    Categorising the forums into a more hierarchical layout is usually far more friendly for admins, mods, and users. For example break down the UK to England, Scotland, Wales, and Northern Ireland, then further break them down, under Scotland you’d have Aberdeenshire, Dumfries and Galloway and so on….

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