I think including a counter like this would do the trick. Does this help?
<?php
$showposts=2;
$counter=0;
while ( bbp_topics() ) : bbp_the_topic();
$counter++;
if(counter<=$showposts) {
?>
/*** Do stuff ***/
<?php
}
else {
break;
}
endwhile;
?>
Related Posts:
- Creating nested forum loops in bbPress [closed]
- It is possible to encounter horrible bugs if I place a main loop that uses `query_posts` right above the main bbPress loop?
- How can i display the content in plaintext
- How to force excerpts / teasers in the loop
- Why am I being limited to ten posts on a custom loop?
- Child Pages Loop
- Loop.php vs looping inside template file
- Insert/sticky specific post into Loop at specific location
- Style every four posts differently [duplicate]
- Return vs Echo Shortcode
- have_posts() return false but count says “3”
- next_posts_link not working in custom loop
- Ajax loop in sidebar to load post titles/categories
- How to sort posts in archive loop
- wordpress post loop in javascript
- How to iterate through database until it find a match
- Show top level comments ordered by number of replies
- Redirect Loop to Page, Can’t Find Origin, Can’t Remove [closed]
- Loop through pages with specific template
- Loop starts from the beginning with second while loop on author.php
- wordpress change the loop order by dynamic value
- Post Format single-loop.php using get_template_part
- Display content of page template (get_page)
- Single page site (WordPress) including posts
- Meta Query with spaces in value?
- A loop with all articles with certain text strings in tags
- Prevent Headers from being sent
- How do I get row padding in a post feed?
- Display the_content on click jquery
- How can I create a legend (Key) like the one in the footer on WordPress StackExchange
- Missing image in gallery shortcode in custom feed
- Styling text and images in the_content()
- How do I use AJAX Query in my posts loop?
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Duplicate posts in paginated results
- Output loop leveraged shortcode twice on one page
- Alter query using pre_get_posts() if meta_key is present
- Next Posts Prev Posts for Standard post format only
- Two loops on different pages do the same thing, but only one page works
- Genesis multiple category custom loop 404s after first page
- Shortcode in posts called by ajax is not working
- Using Javascript for Looped Content
- Added if statement to loop
- How to get The Loop working with $wpdb->get_results()
- Making a query to the DB using same parameters of loop
- Variable not being passed into WordPress loop
- Exclude duplicated $sticky post from combined loop content
- Group posts by date with a list
- Add class to last 3 posts in loop
- Will only show the first 10 wordpress posts instead of all my posts
- WP Loop. If featured image is a panorama (3:1 ratio) execute some code
- Trying to get property of non-object in shortocde
- displaying recent comments outside loop without plugin
- get_the_ID not returning correct ID value
- How to Loop with the final result formatted differently?
- Tags on page (not post) returns nothing – why? Improved clarified question!
- Include future posts in tags and in search
- loop inside the foreach
- How to display 3 post per slide
- How to put a block of code between [shortcode][/shortcode] in do_shortcode()?
- current-user_can not working in loop
- Show terms in archive page
- How can I access a post’s feature image outside the loop?
- Multiple loops for plugin
- Loops for cat links not looping for wordpress site
- How to get post category and author name for cusmot API?
- How do I set the Stewart Search Template to return only published posts in the result
- How to add Default Level-0 parent and Level-1 class in WordPress Category in li element?
- Updating Post meta (ACF field) from Feed
- How to add pagination in Terms
- A code that I could not fully grasp related to foreach & count_user_posts()
- How to separate post titles with a comma in the loop?
- get_posts changes main query
- Trying to get property ‘post_content’ of non-object
- WordPress loop : how to exclude some posts with their status?
- Include only one category but Exclude if is in a category from loop
- Homepage Loop Somehow Breaks Styling Of Post Grid
- WordPress Pages in an Array
- numberposts not responding to wp_reset_postdata()
- Next 10 posts data of currently viewing post in blog page
- Why my title change the last post title in my loop?
- Get child taxonomies in loop
- Have multiple loops on a page appear after/between page content
- WordPress Multiple Loop: Home/Archives Page, with pagination
- Placing the content of one post in two side by side columns, newspaper style
- trying to write a variable into a wp_query, need help!
- One loop for sticky, one for all the rest – how, without specifying category?
- Pass WP post content to a jQuery plugin (Fancybox)
- Showposts doesn’t show the number of posts indicated
- Using in_category for non standard loops
- Use Loop or direct database query?
- Creating mulitple loops in a sub-category page
- How wp maps urls into files
- Custom Page Template and Category Exclusion
- Display Featured Image
- AJAX in wordpress theme loop
- Loop that displays all posts by logged in user, with Post Edit link
- How to store wordpress title in a variable
- How to split the loop every 2 and 5 results? [closed]
- Hook in the loop after the first post