The [bbp-topic-index] shortcode will use the default 15 topics based on bbPress ‘Topics per page’ setting, upping this to 25 will show 25 topics per page on the topics view (example.com/topics), the topics page for each single forum and again the same for any place you use the above shortcode.
Thanks Stephen. So I managed to get about same design for the forum’s home page, that is forums in a widget on the leftside bar, and recent topics in the page space (using the shortcode). I used a page template in a child theme for this. Now when I open a forum, I want to have forum content as the page (will use bbp-single-forum shortcode), and forum info as the widget in sidebar. But how can I set up thing so a specific sidebar appears when a forum content is being displayed?
Checkout bbPress’ ‘Conditional Tags’ https://codex.bbpress.org/bbpress-conditional-tags/
I think they are pretty straight forwardly named so then checkout WordPress’ page and this specific sidebar example:
https://codex.wordpress.org/Conditional_Tags#Variable_Sidebar_Content
Is there a shortcode to display same thing as the widget used on the support forum, listing all the available forums with post count for each? I am using the forum index widget but this one is only listing the forum names.
I guess I can write some code using bbp_list_forums, then looping over the results and usnig bbp_get_forum_post_count for each one. If there is some sample code out there to do this I’d rather use it too 🙂 Thanks.
I am trying to use bbp_list_forums in sidebar.php in a child theme, but that doesn’t work, do I need to make some includes to get to bbpress functions?
I got bbp_list_forums to work, but this function does seem to only list subforums! What if I want to display top level forums?
I finally managed to get to something displaying the top level forums. Guys it took me hours to do something so simple. Really should be part of the documentation somewhere. Pasting the code here in case if helps someone:
if (bbp_is_forum_archive()) {
$forums = bbp_get_forums_for_current_user();
echo '<ul>';
foreach ( $forums as $forum ) {
if ($forum->post_parent == 0) {
echo '<li><a href="' . bbp_get_forum_permalink($forum->ID) . '">';
echo $forum->post_title;
echo '</a></li>';
}
}
echo '</ul>';
}
Thanks for sharing your code and and yes some more docs on this would be great.
Anyone can add docs to the bbPress codex https://codex.bbpress.org/
You just need to login with the same username and password you use here on bbpress.org
https://codex.bbpress.org/wp-login.php
Have a look at the current pages and or create a new page
https://codex.bbpress.org/wp-admin/edit.php?post_type=page