- Use a regular old WP_Query()
- Use a widget
- Use bbp_has_forums()
- Use the shortcode mentioned above
There are lots of examples, in the forums, on the codex, and in the bbPress code itself. Also, unclear what you mean by โlatest forum.โ Do you mean topics, or replies, or something else?
Widget and shortcode are not so “themable” like I would. WP_QUERY is right, but then I cannot use bbp_* in my file.
What I want is use every BBP Functions inside my, eg, single.php: show author, show forums, show topic simple calling bbp_**
How bbp_has_forums() works? It loads the functions ouside the BBP pages?
Regards, Francesco.
bbp_list_forums needs to be run inside a bbpress loop. Which you call with bbp_has_forums(), which creates a forum object. For example.
bbp_set_query_name('load_stuff');
if ( bbp_has_forums(array(
'post_parent' => 0,
'post_type' => bbp_get_forum_post_type(),
'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
'orderby' => 'menu_order',
'order' => 'ASC'
)) ) : ;
bbp_get_template_part( 'loop', 'forums' );
else : ;
bbp_get_template_part( 'feedback', 'no-forums' );
endif;
bbp_reset_query_name();