Comments icon disappears on blog page after comments close?

Home Forums Spacious Free Comments icon disappears on blog page after comments close?

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Rajesh 2 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1379712

    Dominik D.
    Participant

    On my website’s blog (premiumminecraft.com) I made it so that comments close after 90 days. And as you know, on the Blog page, by every post there’s the category, read more button etc. – as well as an icon showing the number of comments. But the thing is, once the comments close after 90 days, that icon showing the no. of comments disappears. Is there a way to make it stay, so that people can see how many comments a post had when the comments section was open? It’s a small but annoying issue. Thanks!
    Also, I’ve got a question – my comments close after 90 days, but will they stay open forever on pages? I have a Gallery page where comments are enabled, and I do not want them to close, unlike on posts.
    Please help\

    #1379833

    Rajesh
    Moderator

    Hi @Dominik D.,

    You can make the comment number appear after the comments close by making a child theme. You can take a reference to make a child theme from the following link.
    https://themegrill.com/blog/tutorial-creating-wordpress-child-theme/

    After making a child theme, you can make a functions.php file and then copy the code from parent theme. After that, you can find and replace comments_open() with get_comments_number() in the functions.php like shown below.

    if ( get_comments_number() ) { ?>
    				<span class="comments"><?php comments_popup_link( __( 'No Comments', 'spacious' ), __( '1 Comment', 'spacious' ), __( '% Comments', 'spacious' ), '', __( 'Comments Off', 'spacious' ) ); ?></span>
    <?php }

    For the second query, the comment can’t be disabled only in a post as you mentioned.

    Thanks.

    #1381053

    Dominik D.
    Participant

    Hmm, the second issue I fixed, but the first (the code)… either I don’t get it or I did it wrong or it doesn’t work… I made the child theme ok, but I cannot find a comments_open() or anything, and just pasting the code itself doesn’t work… Could you explain it more or something, as it would be good to have the comments icon show the number of comments all the time for posts, even closed..?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.