Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show last 3 recent topics


  • softgenic
    Participant

    @softgenic

    Hi Guys,

    I am trying to show last 3 recent topics in this form: http://prntscr.com/f00irx . Can anyone please tell me what should be the wp query or PHP code to get title, topic url, author avatar image & time so I can easily get the information and then show it in the layout I created in the above screenshot for showing last 3 recent topics?

    Thanks

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

  • Robin W
    Moderator

    @robin-w

    if you are happy with code, download my style pack plugin

    bbp style pack

    if you look in includes/shortcodes

    you’ll find a shortcode for bsp_display_topic_index

    around line 40 you’ll find the output that you could modify and then style.


    softgenic
    Participant

    @softgenic

    Hi Robin, Your plugin is great but I just need a simple PHP code to loop through this just like we loop through wordpress posts using wp query., is there any way I can run a simple code to get the data of last three recent posts and then I can easily render the information in my created HTML


    Robin W
    Moderator

    @robin-w

    thee problem is that the code would take me time to work out, and I just don’t have any time free at the moment.


    softgenic
    Participant

    @softgenic

    No worries Robin, no rush, if you have sometime later ever then please do let me know if its not too much to ask for.


    softgenic
    Participant

    @softgenic

    I manage to do this by PHP code but I am now facing one small issue the freshness time that’s coming through bbpress recent topic widget is different as compared to the freshness that’s coming through <?php printf( __( 'Last Post: %1$s', 'bbpress' ),bbp_get_topic_freshness_link( array('post_id' => get_post_meta( get_the_ID(), '_bbp_last_active_id', true )) ) ); ?> so can you please let me know how to atleast make sure the freshness time is correct?


    Robin W
    Moderator

    @robin-w

    the topic link is to a specific topic, not an array, so should be something as simple as

    <?php bbp_topic_freshness_link( $post_id) ; ?>

    where $post_id is the topic number

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar