bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

Count subforum posts in parent count?

(3 posts)
  • Started 1 year ago by Phayze
  • Latest reply from beernews
  • This topic is not resolved
  1. Hi,
    Is it possible to modify my forums loop (below) to count the posts in subforums in the total for the parent? My subforums are displayed inline, rather than in a separate row, and the parent forum looks a bit weedy without the "real" count.

    <?php while ( bb_forum() ) :
    global $bb_forums_loop;
    $_loop =& $bb_forums_loop;
    if($_loop->walker->depth >= 2) : ?>
    <tr<?php bb_forum_class(); ?>>
    <td colspan="3" class="subforums"><?php bb_forum_pad( '<div class="nest">' ); ?>Subforums:
    <?php
    while ($_loop->walker->depth > 1) :
    if($_loop->walker->depth > 2) {
    bb_forum();
    continue;
    }
    ?>
    "><?php forum_name(); ?><?php
    bb_forum();
    if ($_loop !== null && $_loop->walker->depth > 1)
    echo ', ';
    endwhile;
    ?>
    </td>
    </tr>
    <?php endif; ?>
    <?php if ($_loop !== null) : ?>
    <tr<?php bb_forum_class(); ?>>
    <td class="topic"><?php bb_forum_pad( '<div class="nest">' ); ?>"><?php forum_name(); ?>
    <?php forum_description();?><?php bb_forum_pad( '</div>' ); ?></td>
    <td class="num"><?php forum_topics(); ?></td>
    <td class="num"><?php forum_posts(); ?></td>
    </tr>
    <?php endif; endwhile; ?>

    Thanks,

    Posted 1 year ago #
  2. You'd have to do a custom mysql call to get the total but yes it is possible.

    Posted 8 months ago #
  3. Would love to see an admin option for this in the next release though not a priority given you can stay on top of proper tagging which will provide a similar categorization effect.

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.