Skip to:
Content
Pages
Categories
Search
Top
Bottom

Help with forum display


  • KipFisher
    Participant

    @kipfisher

    Hi everyone…

    I hope I’m not posting this in the wrong place, but I have a question. I’m an absolute neophyte with bbPress, only having installed it a couple days ago. I’ve tinkered around with a lot, but I’m having trouble with the following. My forum index displays as show in the first image. I WANT it to display as the forum page itself does in the second image. Any ideas where I might find that and make the proper change?

    Forum Index

    Forum Page

Viewing 10 replies - 1 through 10 (of 10 total)

  • Robin W
    Moderator

    @robin-w

    What wordpress theme are you using?


    KipFisher
    Participant

    @kipfisher

    Weaver ii Pro

    w/child theme. I’ve been using this to style bbpress:

    https://github.com/EpicWebs/bbPress-starter-theme-epicwebs


    Robin W
    Moderator

    @robin-w

    ah..

    I would expect it to look like the second by default. If you take out the starter theme does it revert to that?


    KipFisher
    Participant

    @kipfisher

    Holy Cow! I renamed the starter theme via my cPanel, and it all looks exactly how I wanted. Sometimes I just make stuff harder than it has to be.

    Thanks a ton! I was expected something much more difficult…


    KipFisher
    Participant

    @kipfisher

    It isn’t showing me the subforum descriptions from the main index page, but I can live with that.


    Robin W
    Moderator

    @robin-w

    add the following to your functions file, and the sub forum descriptions will display

    //This function adds descriptions to the sub forums
    function custom_list_forums( $args = '' ) {
    
    	// Define used variables
    	$output = $sub_forums = $topic_count = $reply_count = $counts = '';
    	$i = 0;
    	$count = array();
    
    	// Parse arguments against default values
    	$r = bbp_parse_args( $args, array(
    		'before'            => '<ul class="bbp-forums-list">',
    		'after'             => '</ul>',
    		'link_before'       => '<li class="bbp-forum">',
    		'link_after'        => '</li>',
    		'count_before'      => ' (',
    		'count_after'       => ')',
    		'count_sep'         => ', ',
    		'separator'         => ', ',
    		'forum_id'          => '',
    		'show_topic_count'  => true,
    		'show_reply_count'  => true,
    	), 'list_forums' );
    
    	// Loop through forums and create a list
    	$sub_forums = bbp_forum_get_subforums( $r['forum_id'] );
    	if ( !empty( $sub_forums ) ) {
    
    		// Total count (for separator)
    		$total_subs = count( $sub_forums );
    		foreach ( $sub_forums as $sub_forum ) {
    			$i++; // Separator count
    
    			// Get forum details
    			$count     = array();
    			$show_sep  = $total_subs > $i ? $r['separator'] : '';
    			$permalink = bbp_get_forum_permalink( $sub_forum->ID );
    			$title     = bbp_get_forum_title( $sub_forum->ID );
    			$content = bbp_get_forum_content($sub_forum->ID) ;
    
    			// Show topic count
    			if ( !empty( $r['show_topic_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    				$count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );
    			}
    
    			// Show reply count
    			if ( !empty( $r['show_reply_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    				$count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );
    			}
    
    			// Counts to show
    			if ( !empty( $count ) ) {
    				$counts = $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after'];
    			}
    
    			// Build this sub forums link
    			$output .= $r['before'].$r['link_before'] . '<a href="' . esc_url( $permalink ) . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after'].'<div class="bbp-forum-content">'.$content.'</div>'.$r['after'];
    		}
    
    		// Output the list
    		return $output ;
    	}
    }
    
    add_filter('bbp_list_forums', 'custom_list_forums' );

    KipFisher
    Participant

    @kipfisher

    I got an error message after doing that. I apologize for my incompetency, but I know absolutely nothing about correcting it. Here’s what I got when changing:

    Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in /home4/tymorf/public_html/wp-content/themes/weaver-ii-pro-child/bbpress-functions.php on line 185


    Robin W
    Moderator

    @robin-w

    Please don’t apologise for inexperience, we’re were all there once !

    Just double checked it and the code is fine.

    Probably an issue with you either not copying across fully, or a paste error.

    Delete the code, copy across again and retry

    if it still fails, come back with the bit of code that is on the line it falls at (and the line before please!)

    and I’ll look further


    KipFisher
    Participant

    @kipfisher

    Woohoo! It’s working. Thanks so much!


    Robin W
    Moderator

    @robin-w

    You’re welcome !

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