Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbp_get_forum_topic_count

Codex Home → bbp_get_forum_topic_count

Description

The ‘bbp_get_forum_topic_count’ function is used to return the total topic count of a forum including sub forums.

How to use it

<?php bbp_get_forum_topic_count( $forum_id, $total_count ); ?>

$forum_id (optional) – Returns count for particular forum id
$total_count (optional) – Returns the total topic count with true including sub forums or just topics within that forum with false

Used by bbp_forum_topic_count() for displaying counts

Sample code example

<?php bbp_get_forum_topic_count(); ?>

Returns the total count of all topics within the current forum and sub forums

<?php bbp_get_forum_topic_count( '1' ); ?>

Returns the total count of all topics within the forum with an ID of 1

<?php bbp_get_forum_topic_count( '', false ); ?>

Returns the count of topics within the current forum not including topics in sub forums

Skip to toolbar