The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Question [Solved] Hottest Comment Threads Filter Button
✦ Summarize Topic
✦
✦
✦
AI is analyzing the discussion...
(@doctorbr)
Posts: 32
Trusted 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
Show original
Translating...
[#8631]
The first image shows that the Hottest Comment Threads Filter Button appears even when there is no comments!
The second image shows the Comments Sorting Buttons as well as the Hottest Comment Threads Filter Button as it has to be, as there are 16 comments.
Is it possible to use a snippet code to correct the problem or is it necessary to update the wpDiscuz plugin?
If so, what would be the code?
Thanks in advance!
Posted : 05/07/2024 6:15 am
(@asti)
Posts: 8267
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
Show original
Translating...
Hi,
We'll check and get back to you soon.
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 : 05/07/2024 11:34 am
(@doctorbr)
Posts: 32
Trusted 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
Show original
Translating...
Hello,
Any news about this?
Thanks in advance!
Posted : 10/07/2024 5:04 am
(@asti)
Posts: 8267
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
Show original
Translating...
@doctorbr
You can use the code below to control the display of the filters and sorting buttons:
const commentsCount = parseInt(jQuery('.wpd-thread-info').attr('data-comments-count'), 10);
if (isNaN(commentsCount) || (typeof commentsCount === 'undefined') || commentsCount < 1) {
jQuery('.wpdf-hottest').hide();
}
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 : 10/07/2024 1:19 pm
(@doctorbr)
Posts: 32
Trusted 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
Show original
Translating...
@Asti
I can't activate the PHP code. See the error:
We encountered an error activating your snippet, please check the syntax and try again. Error message: syntax error, unexpected identifier commentsCount
Posted : 11/07/2024 1:38 am
(@asti)
Posts: 8267
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
Show original
Translating...
@doctorbr
This is a javascript code, not the PHP.
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/07/2024 2:10 pm
(@doctorbr)
Posts: 32
Trusted 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
Show original
Translating...
@Asti
Still does not work.
What can be wrong?
Posted : 11/07/2024 11:20 pm
(@asti)
Posts: 8267
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
Show original
Translating...
@doctorbr
Try this one:
jQuery(document).ready(function() {
const commentsCount = parseInt(jQuery('.wpd-thread-info').attr('data-comments-count'), 10);
if (isNaN(commentsCount) || (typeof commentsCount === 'undefined') || commentsCount < 1) {
jQuery('.wpdf-hottest').hide();
}
});
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 : 12/07/2024 2:42 pm
(@doctorbr)
Posts: 32
Trusted 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
Show original
Translating...
@Asti
It worked, but Lighthouse accused errors!
What can be done to avoid these errors?
PS. I used your code to create another to hide the comments sorting buttons too...
jQuery(document).ready(function() {
const commentsCount = parseInt(jQuery('.wpd-thread-info').attr('data-comments-count'), 10);
if (isNaN(commentsCount) || (typeof commentsCount === 'undefined') || commentsCount < 2) {
jQuery('.wpdf-sorting').hide();
}
});
Thanks in advance!
Posted : 13/07/2024 5:01 am
(@doctorbr)
Posts: 32
Trusted 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
Show original
Translating...
@Asti
I disabled the additional snippet I mentioned and limited your snippet exclusively for posts (location: site wide header).
Errors no longer appear in Lighthouse and I hope I have done nothing that harms my site or the wpDiscuz plugin. 🤔
But I would still like to hide the comments sorting buttons too!
Please, could you change your code so that the comments sorting buttons are also hidden when there is only 1 comment?
In my opinion it makes no sense to show filters when there is 1 comment. Filters cannot do anything with only 1 comment. 🙂
Thanks in advance!
Posted : 13/07/2024 6:32 am
(@doctorbr)
Posts: 32
Trusted 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
Show original
Translating...
@Asti
Any news about this?
Thanks in advance! 🙂
Posted : 16/07/2024 3:50 pm
(@asti)
Posts: 8267
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
Show original
Translating...
@doctorbr
The code doesn't only affect the wpDiscuz plugin; the addons that may have added filter buttons also require changes.
The JS code we've provided should work fine.
You can also customize the class.WpdiscuzWalker.php file if you're familiar with PHP. More info here: https://wpdiscuz.com/docs/wpdiscuz-7/customization/custom-template-and-style/
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 : 16/07/2024 11:04 pm
(@doctorbr)
Posts: 32
Trusted 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
Show original
Translating...
(...) The JS code we've provided should work fine (...)
Worked, but I would still like to hide the comments sorting buttons too.
Please, could you change that code so that the comments sorting buttons are also hidden when there is only 2 comment?
Thanks in advance!
Posted : 16/07/2024 11:43 pm
(@asti)
Posts: 8267
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
Show original
Translating...
@doctorbr
We will add a new function to the wpDiscuz core code so that if there is only one comment, all filtering/sorting buttons will not be displayed. Please wait for the next update (no ETA yet).
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 : 19/07/2024 12:59 pm
(@doctorbr)
Posts: 32
Trusted 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
Show original
Translating...
I saw that v7.6.22 has fixed the problem and now the filtering buttons are visible only if there is at least one comment.
Thank you very much. 🙂
Posted : 25/07/2024 10:00 pm
Super Globals
Options and Features