bbPress

Simple, Fast, Elegant

bbPress support forums » Themes

Hiding subforms on your home page

(2 posts)
  • Started 4 months ago by dragosbogdan
  • Latest reply from _ck_
  • This topic is not resolved
  1. dragosbogdan
    Member

    I've seen this issue posted on multiple threads, but I couldn't find the solution in any of them. my issue is simple: I want to hide children forums and only display parent forums on the main page of my site. My theme uses the following code to display the forum list:

    <?php foreach ( $forums as $forum ) : ?>

    <tr<?php alt_class('forum'); ?>>
    <td>"><?php forum_name(); ?> — <small><?php forum_description(); ?></small></td>
    <td class="num"><?php forum_topics(); ?></td>
    <td class="num"><?php forum_posts(); ?></td>
    </tr>

    <?php endforeach; ?>

    What should I change?

    Posted 4 months ago #
  2. There are plenty of threads/posts about this, try this:

    http://bbpress.org/forums/topic/hiding-subforums-subforums-from-subforum-pages#post-17436

    You want code like this:

    <?php $forum_parent=$forum_id; ?>
    <?php while ( bb_forum() ) : ?>
    <?php if ($GLOBALS['forum']->forum_parent==$forum_parent) { ?>
    <tr<?php bb_forum_class(); ?>>
    	<td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><small><?php forum_description(); ?></small><?php bb_forum_pad( '</div>' ); ?></td>
    	<td class="num"><?php forum_topics(); ?></td>
    	<td class="num"><?php forum_posts(); ?></td>
    </tr>
    <?php } ?>
    <?php endwhile; ?>
    Posted 3 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.