The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
How to show limited...
 
Share:
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 wpDiscuz community!

Merry Christmas and Happy Holidays! 🎄

Question How to show limited comments with “Load More” on a specific page only?

2 Posts
2 Users
0 Reactions
151 Views
Posts: 1
Topic starter
(@daniel)
New Member
Joined: 3 weeks ago

Hi there,

I’m using wpDiscuz on a website where one specific page acts as a small “micro-comment feed”. The site owner posts regular updates, and visitors can reply so it becomes an interactive conversation thread.

For that one page, I’d like to limit the number of comments initially shown (to keep the section from becoming too tall) and then show either pagination or a “Load more” button.
On all the other pages and posts of the site, wpDiscuz should continue to display the comments normally, without pagination or limits.

However, none of the approaches suggested by AI tools work so far.

I’m using the shortcode
[wpdiscuz_comments]
inside a Code Module in Divi.

Here’s an example of code that was suggested but does not work:

function custom_wpdiscuz_comment_order($order, $post_id) {
if ($post_id == 123) { // Specific page ID
return 'DESC'; // Newest first
}
return $order;
}
add_filter('comment_order', 'custom_wpdiscuz_comment_order', 10, 2);

Do you have any recommendations on whether it’s possible to limit the number of visible comments or enable “Load more” only on one specific page, while keeping the default behaviour everywhere else?

Thanks in advance!


1 Reply
Asti
Posts: 8205
 Asti
Support
(@asti)
Illustrious Member
Joined: 8 years ago

Hi,

Please find the code below: 

//comments_per_page
add_filter('wpdiscuz_comments_args', function ($args) {
    $postId   = 84;
    $commentPerPage = 2;
    if ($args['post_id'] === $postId) {
        $args['number'] = $commentPerPage;
    }
    return $args;
});

Reply
Share: