Hide ‘zero’ comment count

Posted in: Newsmag
Post count: 93

Hi,

is it possible to hide the comment count box on modules and blocks when it is a ZERO count but only show when some one actually comments on the article?

It just looks bad in my opinion when you have o showing on all the blocks across the whole website.

Screenshot-6<br />free dice spinner game<br />

Post count: 9544

We just turned that off as nobody really cares how many comments a post has. Especially with some many sites polluted by spam and bot posts. Probably only attracts more trolls to chime in that they hate coffee made in a drip machine and pour over is the only way! 😉

Post count: 93

To be fair due to the security features we use spam and bots very rarely happen.

Post count: 9544

Fair enough. Some of our sites have been online 20+ years so high value targets 🙂

Post count: 20685

Hi,

Normally that isn’t possible. You could use a code to achieve it, something like this would work https://pastebin.com/my9bp0xt It can be entered here https://prnt.sc/H8oVdoxGzl6z The code should hide all the comments counts with the 0 value, and show only the ones that have a different value. You could give it a try.

Thank you!

Post count: 93

Thank you Simion.

There is a slight delay before it removes the 0 count box on the blocks but it still works.

Thank you once again!

Post count: 2

@Simion C.

Could you tell me how to change the ‘Comment background’ with the number of comments to a color other than the default one?

Example: when there are 3 comments under an article, the color changes to red. by default it is blue – set in the panel.

Post count: 20685

Hi,


@medialubaczowskie

So when there are comments, the comments icon should have a different background color. That could be done.

Try this code https://pastebin.com/xhwuatef in the theme panel here https://prnt.sc/v_AiJUURhOSE
And this code https://pastebin.com/ARWZiE5K here https://prnt.sc/fm6rsCyAx7hP

The result should be like this https://prnt.sc/5kxGarN-UwD1 You can change the color in both codes if you want a different one. Please give it a try. It may be needed to clear the cache after entering them, in case you are not seeing the change.

Thank you!

Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic.