Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display 3 topics with new replies


  • Radzio125
    Participant

    @radzio125

    Hi, I want to display 3 latest topics with new replies for each forum category. In loop-single-forum.php file I created this:

    $count = bbp_get_forum_topic_count();
    $user = bbp_get_topic_author_id( bbp_get_forum_last_topic_id() );
    if ( $count != 0 ) {
    	echo '<a href="'. bbp_get_forum_last_topic_permalink().'"></a>'; // Link to the topic
    	echo'<a href="'. bbp_get_user_profile_url( $user ) .'"><img class="avatar" src="'. bp_core_fetch_avatar ( array( 'item_id' => $user, 'type' => 'full', 'html' => false ) ).'" /></a>'; // Link to the topic author profile with author's avatar
    	echo '<div class="title">'. bbp_get_forum_last_topic_title().'</div>'; // Title of the topic with last activity
    	echo '<div class="activity">Last activity '. bbp_get_forum_last_active_time().'</div>'; // Time of the topic last activity
    } else {
    	echo 'No topics'; // Information if there is no topics
    }

    How to display two more topics (if they exist)?

  • You must be logged in to reply to this topic.
Skip to toolbar