Skip to:
Content
Pages
Categories
Search
Top
Bottom

Posts 2 Posts: Given a forum id – , how I can I display a list of recent topics?

Viewing 5 replies - 1 through 5 (of 5 total)

  • eternal noob
    Participant

    @hjertelandetdk

    I know I can use a shortcode to fetch topics and replies – but a template tag as in <?php …..?> that automagically fetches the topics and/or replies if there is any is probably what I am looking for.


    Lynq
    Participant

    @lynq

    Using

    bbp_list_forums( array ('forum_id' => '') );

    will return a list of the forums, you just need to specify it with a forum ID. Which you might be able to get from your post meta data?


    eternal noob
    Participant

    @hjertelandetdk

    @Lynq – help me more… (smiling)

    How can I check what is in the post meta data ?

    And would that be a template tag I put in my post.php-template like:

    <? bbp_list_forums( array (‘forum_id’ => ”) );?>

    Or ?

    Thanks, Jacob.


    eternal noob
    Participant

    @hjertelandetdk

    Oh, just to be clear: Actually I dont need a list of the forums – I need a list of the topics from a forum that i have made a relation to. As if I used a widget Recent topics from X forum.


    Lynq
    Participant

    @lynq

    Oh right ok.

    You may want to use something like:

    if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => true, 'order' => 'DESC', 'posts_per_page' => 5 ) ) )
    bbp_get_template_part( 'bbpress/loop', 'topics' );

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.