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:

AI Assistant
How to show the cou...
 
Notifications
Clear all

[Solved] How to show the count of the comments left on the "Load more" button.

1 Posts
1 Users
0 Reactions
4,805 Views
Asti
 Asti
(@asti)
Illustrious Member Support
Joined: 8 years ago
Posts: 8217
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
  [#3546]

Started from the wpDiscuz 7.3.10 version we've added two new hooks:

The wpdiscuz_show_comments_left is designed for showing the count of the parent comments left on the "Load more" button. By default, the count is not displayed. If you want to show it, just put the hook-code below in the active theme functions.php file: 

add_filter("wpdiscuz_show_comments_left", "__return_true");

This video shows how the hook-code works:

The second wpdiscuz_comments_left_text hook allows you to change the text, that displays the number of the parent comments that are not displayed yet on the "Load more" button. This is not required, you can use it just in case if you want to change the text.

For example:

add_filter("wpdiscuz_comments_left_text", function ($text, $args) {
    if (!empty($args["comments_left"])) {
        $text = "[{$args["comments_left"]}]";
    }
    return $text;
}, 10, 2);

In this case, the default (X) format will be replaced with [X].

hook result

This article describes how to easily add custom code in WordPress: https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

 


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.


   
Share: