Info
- 2 posts
- 2 voices
- Started 3 years ago by dragosbogdan
- Latest reply from _ck_
- This topic is not resolved
Hiding subforms on your home page
-
- Posted 3 years ago #
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 3 years ago #
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; ?> -
You must log in to post.