Skip to:
Content
Pages
Categories
Search
Top
Bottom

Put each subforum on own line?

  • @nykess

    Participant

    By default, the subforums look like this:

    subforum1, subforum2, subforum3, subforum4, etc.

    I want for it to look like this:

    subforum1
    subforum2
    subforum3
    subforum4
    etc.

    How can I accomplish this?

Viewing 11 replies - 1 through 11 (of 11 total)
  • @netweb

    Keymaster

    The full docs for bbp_list_forums is here https://codex.bbpress.org/bbp_list_forums/

    The quick and easy way is via this topic where you can add the code from that gist to your themes functions.php

    how to display list of sub-forums on separate lines, instead of big blob?

    @kriskl

    Participant

    there is a way to do it, someone posted few lines of code last year.. and it works. BUT I cannot find it now here on the forums, and I can’t remember how it was done :((

    please search bbpress forums

    @nykess

    Participant

    After giving it some thought, how can I edit this code so that it puts the subforums into two or three columns instead of one column only?

    function custom_bbp_list_forums() {
      $args['separator'] = '<br />';
     
      return $args;
    }
     
    add_filter('bbp_before_list_forums_parse_args', 'custom_bbp_list_forums' );

    @netweb

    Keymaster

    You kind of only have two options, the default bbPress behaviour like this:

    • My Parent Category/Forum
    • My 1st Child Forum (78, 425), My 2nd Child Forum (18, 107)

    Or using the <br /> as the separator:

    • My Parent Category/Forum
    • My 1st Child Forum (78, 425)
    • My 2nd Child Forum (18, 107)

    Each element is returned as a whole so My 1st Child Forum (78, 425) and My 2nd Child Forum (18, 107) CANNOT be broken down further for multiple columns like this (which I think you are alluding to:

    • My Parent Category/Forum
    • My 1st Child Forum78425
    • My 2nd Child Forum18107

    @nykess

    Participant

    Thank you for your reply. What I would like to do is this:

    • Subforum 1 (0, 0)Subforum 2 (0, 0)
    • Subforum 3 (0, 0)Subforum 4 (0, 0)
    • Subforum 5 (0, 0)Subforum 6 (0, 0)
    • etc.

    @netweb

    Keymaster

    Your going to have to use $args['separator'] = ' '; (Either a blank space or empty) and then use some CSS to style the bbp-forum-list element.

    @nykess

    Participant

    If I could use divs or something, I could do it, but using only CSS I don’t know how I would do that. Can you help?

    Thanks.

    @netweb

    Keymaster

    It is not really me expertise, check out what suggestions the author of the theme you are using on your site may have.

    @kriskl

    Participant

    this code should put sub forums the way you want, add it to your functions.php child theme

    function custom_bbp_list_forums() {
    $args[‘separator’] = ‘<br />’;

    return $args;
    }

    add_filter(‘bbp_before_list_forums_parse_args’, ‘custom_bbp_list_forums’ );

    @nykess

    Participant

    Yes, that’s already the code I’m using, but I am looking now to add two columns. Please look through thread.

    Thank you.

    @xevo

    Participant

    Take a look at this, it should help you out.

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