Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hiding subforms on your home page


  • dragosbogdan
    Member

    @dragosbogdan

    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?

Viewing 1 replies (of 1 total)

  • _ck_
    Participant

    @_ck_

    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; ?>

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.