Info
- 10 posts
- 3 voices
- Started 2 years ago by gerikg
- Latest reply from chrishajer
- This topic is resolved
How to get a total count of forums?
-
- Posted 2 years ago #
How do I get a count of how many forums (and sub-forums) on the front page?
"Viewing ### total forums"
-
- Posted 2 years ago #
<p>Viewing <?php echo get_total_forums() ?> forums</p> -
- Posted 2 years ago #
Call to undefined function get_total_forums()
-
- Posted 2 years ago #
That's a valid function in 1.0.2. What version are you using?
http://trac.bbpress.org/browser/tags/1.0.2/bb-includes/functions.bb-statistics.php#L19
-
- Posted 2 years ago #
Version 1.0.2
-
- Posted 2 years ago #
<?php require_once( BB_PATH . BB_INC . 'functions.bb-statistics.php' ); echo '<p>Viewing ', get_total_forums(), 'forums</p>'; ?> -
- Posted 2 years ago #
Thanks! that works great. To go deeper into that code a code that does "forumS" for more than one and "forum" for just one?
-
- Posted 2 years ago #
So the functions in bb-includes are not included on the front end or something? Why would you need to include them again? Are they just admin functions?
-
- Posted 2 years ago #
To go deeper into that code a code that does "forumS" for more than one and "forum" for just one?
$tf = get_total_forums(); printf(__ngettext('Viewing %d forum', 'Viewing %d forums', $tf), $tf);functions.bb-statistics.phpisn't automatically included. Thestatistics.phpfile (http://trac.bbpress.org/browser/tags/1.0.2/statistics.php#L5) does include that file as well. -
- Posted 2 years ago #
Thanks zaerl.
-
You must log in to post.