While redesigning the Theme Hybrid support and community forums, I needed an easy way to show off the list of forums with links to the RSS feeds and number of posts next to each forum name.
What I’ll be showing you in this tutorial is a simple way to do this.
I prefer to have the list of forums in the sidebar while showing the most recent posts in the content area. But, you can use this code in any of your template files for use anywhere on your forums.
The code
What we’ll be doing is using the get_forums() function to grab an array of all of your forums. Then, we’ll loop through the array, listing a link to each forum, showing the number of posts, and linking to the RSS feed.
<div class="forums-list">
<h3>Forums</h3>
<ul>
<?php $forums = get_forums(); ?>
<?php foreach ( $forums as $forum ) : ?>
<li>
<a class="forum-link" href="<?php forum_link( $forum->forum_id ); ?>"><?php forum_name( $forum->forum_id ); ?></a>
<span class="forum-posts">(<?php forum_posts( $forum->forum_id ); ?> posts)</span>
<a class="rss-link" href="<?php bb_forum_posts_rss_link( $forum->forum_id ); ?>">(<abbr title="Really Simple Syndication">RSS</abbr>)</a>
</li>
<?php endforeach; ?>
</ul>
</div>
The finished product
I worked a little extra CSS magic on mine and came up with this:

I hope you have fun with this code and come up with more unique ways to show off your forums. I provided a few CSS classes to help you out if you want to add your own style. Here they are for reference:
/* Containing <div> */
.forums-list {}
/* Header */
.forums-list h3 {}
/* List */
.forums-list ul {}
.forums-list li {}
/* Forum link */
a.forum-link {}
/* Number of forum posts */
span.forum-posts {}
/* Forum RSS Link */
a.rss-link {}
More bbPress tutorials and discussion to come
I’m not really sure how many folks are using bbPress these days, but it’s the forum software of choice for me. It’s simple and lightweight — everything I need in forum software. I hope that I can bring more people to this platform and do my part in helping the bbPress community grow.
I also hope to continue writing more tutorials like this one, so there’ll be more documentation out there. If you have ideas for tutorials, I’ll see if I can squeeze them in sometime.

Nice work Justin.
Due to the somewhat scarce documentation on bbPress, something like this is very helpful. We are using bbPress in our support forums as well and have been extremely happy with it’s simplicity, size, and speed. Another positive: building themes for bbPress is similar to building themes for WordPress.
Drew Strojny — Yeah, I figured someone needed to get the ball rollin’ a bit. I’m sure after 1.0 is out, we’ll start seeing a larger movement toward documenting everything.
I would even argue that bbPress has a more robust templating system than WordPress. It’s pretty easy to start building a theme though. I’m in the middle of creating a blank starter theme right now to build from in the future.
I am a fan of your work, throughnthrough
I am trying to get the bbpress theme to work exactly like you are making it work on themehybrid.com … especially the global menu on the top, that stays ‘as is’ when one is in the forums etc.
How did you do it? I have searched the net and found nothing concrete :/
Thanks for putting this together! Just did a quick search on Twitter to see if I’d find anything to help me decide between BBPress & Simple:Press.
Since one of the first tweets was from you, linking to this post, seems like BBPress is the way to go
Momekh — I’m glad you’re a fan.
As for a global menu, I just created the same menu in the bbPress theme
header.phpfile using a standard unordered list.faryl — Well, if we can gain one bbPress user per tutorial, I’ll be happy. I plan on writing some other bbPress tutorials in the future, so stay tuned.
Very nice, love to see bbPress picking up. I use it for my forums, and love it. Thought I am still learning a lot, and would love to see more, do more and am exited about the closeness of bbPress 1.0.
The more documentation of bbpress the better I say. I’ve been playing around with bbpress for a while, but now that 1.0-RC1 is out I’m excited for where the project is going. I’m in the process of moving away from some custom backend software that I had written for my clients to a wordpress/bbpress based system and there haven’t been any major stumbling blocks so far, they’re both really great pieces of software.
The Frosty — It’s good to hear that you’re using bbPress for your forums. I expect some great things in the near future now that TalkPress is a new service from Automattic based on bbPress.
Keep working at it. bbPress isn’t much different than WordPress in a lot of ways.
Jon — Yes, they are both great pieces of software. It’ll be a long while before the bbPress docs are anywhere close to what we have with WordPress, but I hope to contribute things that I learn whenever I get a chance.
Hi Justin,
I really like your themes. I just set up an news-website about dental health and your news themes might fit to my needs. I’ll play a bit around with it (love it soooo much) and then you might have a new fan
Btw: the bbpress plugin is a great tool!!! Thanks for sharing this information – me and my future visitors will really benefit from that!
Your press-mate
Sikjaer
The more documentation of bbpress the better I say. I’ve been playing around with bbpress for a while, but now that 1.0-RC1 is out I’m excited for where the project is going. I’m in the process of moving away from some custom backend software that I had written for my clients to a wordpress/bbpress based system and there haven’t been any major stumbling blocks so far, they’re both really great pieces of software.
Excellent tutorial Justin, please keep ´em coming !!!
Thanks for that useful tip.
A possible tutorial idea: how to create pages in bbPress.
I tried copying the header and footer files into a new file, and adding the content, but that didn’t work.
Justin, I know this may sound crazy, but do you see any functionality in developing a Hybrid FW just for bbPress ? If my uqestion is real nosense, it is just I know nothing about Wordpress…:-(
I agree with Michael, a tutorial on how to create pages in bbPress would be welcome, I’m learning a lot here in justinadlock, thanks a lot!
Actually, this tutorial got me to install bbPress and attempt to figure out how to theme it. One huge stumbling block is the general lack of documentation. Now that bbPress is 1.0, I think it’s past time to have some kind of documentation to go with it.
That you wrote a tutorial interesting me in this software, and I’m interested in contributing, but there’s currently no place to contribute to that I could find. I doubt the community will grow very much without a codex or something.
I only just found your blog – wow, there’s some good articles here. I’m more than likely going to be here half the night reading and *trying* your stuff.
Clear and helpful tutorial, thank you
Just wanted to show my support for more posts on BBpress. I will be in need of a forum solution and I think I am leaning towards BBpress b/c of its lightness.
I think a great post would be to explain how to create custom templates. This is the one thing that is scaring me a bit, but I am sure with time and persistence it will work out. Or maybe a post on how to integrate wordpress and BBpress, specifically adding links to forums within a “blog” post.
Your first two posts are great, and I will be referencing those when I get started. THANKS
Nice work.Thank you.You are great Justin.
I have added a bbpress to a wordpress. Everything works fine with your help.