The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
How to show limited...
 
Notifications
Clear all

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

2 Posts
2 Users
0 Reactions
696 Views
(@daniel)
Posts: 1
New Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#11133]

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!


 
Posted : 09/12/2025 6:55 pm
Asti
 Asti
(@asti)
Posts: 8257
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

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;
});

In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 11/12/2025 2:16 pm