Skip to:
Content
Pages
Categories
Search
Top
Bottom

Make Forum Category Index page look like Topics page

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

  • kvr28
    Participant

    @kvr28

    copy loop-forums.php from plugins/bbpress/templates/default/bbpress into your theme directory, overwrite whats in the file with this code. bbpress will look for the file first in your theme before it looks in the bbpress directory, that way if bbpress updates, you won’t lose the file update. Should get the look you want

        <?php
         
        /**
         * Forums Loop
         *
         * @package bbPress
         * @subpackage Theme
         */
         
        ?>
         
        <?php do_action( 'bbp_template_before_forums_loop' ); ?>
         
        <?php while ( bbp_forums() ) : bbp_the_forum();
                       
                        /* We print the header only if we want to show a category or if it's the first item of a no-parent forum list */
                        if (bbp_is_forum_category() OR !$bbp_forums_noheader)
                                { ?>
         
                                <ul id="forums-list-<?php bbp_forum_id(); ?>" class="bbp-forums">
         
                                        <li class="bbp-header">
         
                                                <ul class="forum-titles">
                                                        <li class="bbp-forum-info"><?php if(bbp_is_forum_category()) { ?><a>"><?php bbp_forum_title(bbp_get_forum_parent_id()); ?></a><?php } else { _e( 'Forum', 'bbpress' ); } ?>
                                                        <li class="bbp-forum-topic-count"><?php _e( 'Topics', 'bbpress' ); ?>
                                                        <li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? _e( 'Replies', 'bbpress' ) : _e( 'Posts', 'bbpress' ); ?>
                                                        <li class="bbp-forum-freshness"><?php _e( 'Freshness', 'bbpress' ); ?>
                                                
         
                                        <!-- .bbp-header -->
        <?php           } ?>
         
                                <li class="bbp-body">
               
        <?php           /* If the forum is a category, we're gonna make another loop to show its subforums and sub-subforums as if those were forums */
                                if(bbp_is_forum_category())
                                        {
         
                                        $temp_query = clone bbpress()->forum_query;
                                        bbp_has_forums('post_parent='.bbp_get_forum_id());
                                        while ( bbp_forums() ) : bbp_the_forum();
                                        bbp_get_template_part( 'loop', 'single-forum' );
                                        endwhile;
                                        bbpress()->forum_query = clone $temp_query;
         
                                        }
                                                else /* Otherwise, we print the forums the normal way */
                                        {      
         
                                        bbp_get_template_part( 'loop', 'single-forum' );
                                        $bbp_forums_noheader = 1; /* This prevents the header part to be printed again on next post in the loop */
         
                                        } ?>
         
                                <!-- .bbp-body -->
         
        <?php           /* Prints the footer only if :
                                        - it's a category
                                        - or if it's the last forum of a no-parent forum list
                                        - or if the next forum in the loop is a category */
         
                                if(     bbp_is_forum_category()
                                OR      (bbpress()->forum_query->current_post+1) == bbpress()->forum_query->post_count
                                OR      bbp_is_forum_category(bbpress()->forum_query->posts[ bbpress()->forum_query->current_post + 1 ]->ID))
                                { ?>
         
                                <li class="bbp-footer">
         
                                        <div class="tr">
                                                <p class="td colspan4">&nbsp;</p>
                                        </div><!-- .tr -->
         
                                <!-- .bbp-footer -->
         
                        <!-- .forums-directory -->
         
        <?php   unset($bbp_forums_noheader); /* Needed if we have 2+ no-parent forums with at least 1 category between them */
                        }  ?>
         
        <?php endwhile; ?>
         
         
        <?php do_action( 'bbp_template_after_forums_loop' ); ?>
    

    Robin W
    Moderator

    @robin-w

    @kvr28 great looking modification. Just tried it and it fell over with a parse error :

    Parse error: syntax error, unexpected ‘=’ in….line 44

    which is

    bbp_has_forums(‘post_parent=’.bbp_get_forum_id());
    

    Any ideas?


    remymedranda
    Participant

    @remymedranda

    I’m also getting a parse error… Line 40

    Parse error: syntax error, unexpected ‘=’ in /home1/kushman/public_html/wp-content/themes/farmer/bbpress/loop-forums.php on line 40

    Any ideas?


    remymedranda
    Participant

    @remymedranda

    the site I’m getting the error on is kylekushman.com/forum


    kvr28
    Participant

    @kvr28

    I’m not sure, I thought I had found that as a example on here somewhere, but I can’t seem to find it, it’s what I use on my forum and I’m not getting any errors, I just found this example and just tried it on my testing site and it works well, see if it gives you any errors

    https://code.google.com/p/ogre3d-fr/source/browse/wp-content/themes/ogre3d/bbpress/loop-forums.php?r=25

    also lynq made a pretty sweet template pack, maybe try that and see if you like the look

    I have created a bbPress starter theme with a phpBB look and feel


    remymedranda
    Participant

    @remymedranda

    Downloaded the template pack, and added the css that you posted in the other thread,
    everything seems to looks good, except 1 thing…

    Please take a look….http://kylekushman.com/forum/

    Where it says “Directions for using the Message Board” right below the tabs. Anyway to place this in its own grey table field just like where is says write below Cannabis Cultivation….?

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