• I am trying to remove the ‘0 comments’ on the homepage.

    I tried the following code without succes, because it removes the date as well. I want to keep the date and remove the ‘0 comments’:

    .latest-blog .blog-item .blog-item-description span {
    font-size: 11px;
    color: #cccccc;
    display: none;
    margin: -2px 0 0 5px;
    padding: 0;
    }

    Hopefully someone can help me!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Place this code in your functions.php and hopefully it will solve your problem.

    add_filter('comments_number', '_bob_modify_comments_filter', 10, 2);
    
    function _bob_modify_comments_filter($output, $number)
    {
        if ($number == 0) {
            return;
        }
    
        return $output;
    }

    @justinkessen98: @blogohblog’s answer should be the way to go.

    But just to explain why you can’t simply hide the comment count ALONE with basic CSS, it’s because your theme’s code has the date and comment count both inside the same span tag, with no HTML tag separating them so CSS can “select” them individually. That’s why your code hid both 😀

    Thread Starter justinkessen98

    (@justinkessen98)

    @blogohblog thanks for your reply, the code doesn’t work unfortunately.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I hide comment counter under blogpost’ is closed to new replies.