Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the wpForo community!

Merry Christmas and Happy Holidays! 🎄

New Forum - only show 2 or 3 posts for home page

5 Posts
2 Users
1 Reactions
1,159 Views
Posts: 17
Topic starter
(@martinasjam)
Eminent Member
Joined: 2 years ago

I'd like to add a new forum but only show 2 or 3 latest posts for my home page to get new content there. The shortcode i use won't work because I'm already using a feed to pull and code in my functions.php page to show posts from another forum for up to a specific date range.

 

is it possible to only show 2-3 of a separate forum? either through functions.php OR shortcode?

thank you!


4 Replies
Sofy
Posts: 5636
 Sofy
Admin
(@sofy)
Support Team
Joined: 8 years ago

Hi,

We don't follow you well. Could you please rephrase your question? 

I'd suggest you check out the wpForo Boards system. More info here: https://wpforo.com/docs/wpforo-v2/categories-and-forums/forum-boards/


Reply
1 Reply
(@martinasjam)
Joined: 2 years ago

Eminent Member
Posts: 17

@sofy I currently have 2 boards - working well.

  • I'm creating another board that will be featured on the home page
  • For the new board, I only want to show 2 of the most recent posts. (see attached)
  • For my first 2 boards, I added code (see attached) to show more posts for my feed page: https://thebreastcastg.wpenginepowered.com/feed-2/
  • Now, I only want to show the most recent 2 posts for my 3rd board. How can I do that?

Hope this helps.


Reply
Posts: 17
Topic starter
(@martinasjam)
Eminent Member
Joined: 2 years ago

Here's a screenshot of an example of 2 posts I want to show from the new board.


Reply
1 Reply
Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5636

@martinasjam 

The developers suggest using the hook code below: 

add_filter( 'wpforo_recent_posts_limit', function($limit){
    $boardid = WPF()->board->get_current('boardid');
    if( $boardid === 15 ){
        $limit = 2;
    }else{
        $limit = 365;
    }
    
    return $limit;
} );

Here’s a helpful article on safely adding custom code in WordPress:   https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/


Reply