bbp_list_forums will list the sub forums of a parent forum.
Hope that makes sense?
Thanks a lot! I put bbp_list_forums to sidebar to show all forums like here. So what is the right way to do that? It would be nice if i could download template files for the theme used here. At least for the sidebar. 🙂
Here on bbPress.org, I used the forums shortcode, and used CSS to hide a few columns. I did not use bbp_list_forums(), which has a specific purpose outside of what you’re trying to do.
For anyone else who comes here trying to programmatically display the forum index list, you can call shortcodes like this:
echo( bbpress()->shortcodes->display_forum_index() );
For what it’s worth, I don’t know why a function called “list_forums” would display *sub* forums. I would think that would be a function named “list_sub_forums” but, oh well. At least there’s a work around. It’s also worth noting that this might not be the best way to do this. I haven’t done much testing (I’ve done none).
Cheers!
An even easier way to call shortcodes is with the do_shortcode() method.
You can programmatically call the bbp-forum-index shortcode like this:
<?php echo do_shortcode(‘[bbp-forum-index]‘) ?>
I think I figured out a cleaner way: I just wanted a list of links to the forums, not the whole loop with all the columns, so I searched for the code of the Forums list plugin in bbpress.php and used its name in the the_widget() function, like this:
the_widget('BBP_Forums_Widget');
It’s working well for me.