Re: Hiding Subforums’ Subforums from Subforum Pages
Yeah, I like that. I guess a template option for show/supress child fora would be better. Then you could use that db option…
I’m still choosing templates but will work on it.
This is what I had based on _ck_’s snippets:
The theme’s front-page.php just after the forum list titles:
</tr>
<?php $forum_id = 0; //musnake: supress child fora: https://bbpress.org/forums/topic/hiding-subforums-subforums-from-subforum-pages#post-20150 ?>
<?php $forum_parent=$forum_id; //musnake ?>
<?php while ( bb_forum() ) : ?>
<?php if ($GLOBALS['forum']->forum_parent==$forum_parent) { //musnake ?>
<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 echo $GLOBALS['forum']->views; ?></td>
<td class="num"><?php forum_posts(); ?></td>
</tr>
<?php } //musnake ?>
<?php endwhile; ?>
</table>
<?php endif; // bb_forums() ?>
That theme didn’t have the breadcrumbs I wanted, so after much searching (including PHPXref!) I found this: which gets put in your theme’s forum.php:
<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> <?php bb_forum_bread_crumb(); ?></h3>
Hope that helps. Thanks All.
Oh, just to be clear, the //musnake are to point out where the changes are, not to claim any credit!