Codex Home → Developer Resources → Loops Reference → Forum Topics Loop
Forum Topics Loop
The forum topics loop can be used to output a list of forum topics.
Standard Loop
<a class="topic-title" href="" title=" - ">
|
<a href=""> |
<a href="">
<a href="" title="">
|
Accepted Parameters
The bp_has_forum_topics() function will accept a number of parameters that will manipulate the data being returned.
type optional
List forum topics by type.
Accepted arguments: newest,popular,unreplied,tags (if type equals 「tags」, define the 「search_terms」 argument and list the tag you wish to filter by)
Default value: newest
forum_id optional
Return only forum topics from a specific group forum.
Default value: false
user_id optional
Return only forum topics that this user has started.
Default value: false
per_page optional
Number of forum topics to display in the loop.
Default value: 20
page optional
The page to display.
Default value: 1
max optional
The total number of forum topics to return.
Default value: false (no limit)
no_stickies optional
Return 「false」 if you do not want stickies listed at the top of the forum loop.
Default value: all
search_terms optional
Return only groups that match these search terms. When used in conjuction with 「type=tags」, can use search_terms to define the tag name.
Default value: false
Examples
Modifying the forum loop to list forum topics by most popular: