Skip to:
Content
Pages
Categories
Search
Top
Bottom

Maximum number of subforums? (displayed)


  • PinkishHue
    Participant

    @pinkishhue

    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

    @robin-w

    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

    @pinkishhue

    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

    @robin-w

    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

    @pinkishhue

    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

    @pinkishhue

    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

    @pinkishhue

    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

    @robin-w

    ok, thanks for the updates

    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