• Resolved lucid_design

    (@lucid_design)


    On posts where I have closed comments, the “no comments” link still appears below the post, both on the home page and on the single post page.

    You’ll see this here:

    https://albereo.com/melanie

    The first post has closed comments, yet shows a “no comments link”.

    I would like to remove that link. Searched and searched posts on this topic, but nothing seems to refer specifically to this issue.

    Thanks in advance for your brilliant solution.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Open the comments.php file inside your theme directory. Then, find ‘no comments’ words. You can remove that words.

    Thread Starter lucid_design

    (@lucid_design)

    Yes, I have tried that and the words still appear.

    I’m using Black n White theme.

    Did you want to close the comments (no comments possible anymore)
    or did you disable the comments?

    Thread Starter lucid_design

    (@lucid_design)

    I want to keep comments enabled in the Discussion Settings and enable/disable comments on a per post basis.

    I know that if I have comments enabled for a post and no one has commented, the line “No Comments” will appear. That’s OK.

    As I look at my comments.php code, the words “Comments are closed” should appear, but is not. Here is a section of that code:

    <?php else : // this is displayed if there are no comments so far ?>

    <?php if (‘open’ == $post->comment_status) : ?>
    <!– If comments are open, but there are no comments. –>

    <?php else : // comments are closed ?>

    <!– If comments are closed. –>

    <p class=”nocomments”>Comments are closed.</p>

    <?php endif; ?>

    <?php endif; ?>

    I’m going to take a good look at the index.php and single.php files.

    Thread Starter lucid_design

    (@lucid_design)

    Here’s the code from the index.php file:

    <div class=”metabox”>
    <span class=”catlink”><?php _e(‘Related:’); ?> <?php the_category(‘, ‘) ?></span> <span class=”commentlink”><?php comments_popup_link(‘No Comments’, ‘1 Comment’, ‘% Comments’); ?></span> <span class=”editcomment”><?php edit_post_link(‘Edit’, ”, ”); ?></span><?php if (get_the_tags()) : ?><span class=”taglink”><?php _e(‘Tags:’); ?><?php the_tags(‘ ‘, ‘, ‘, ”); ?></span><?php endif; ?>

    Here’s the index page link: https://albereo.com/melanie

    Here is the code from the single.php file:

    <div class=”metabox”>
    <span class=”catlink”><?php _e(‘Related:’); ?> <?php the_category(‘, ‘) ?></span> <span class=”commentlink”><?php comments_popup_link(‘No Comments’, ‘1 Comment’, ‘% Comments’); ?></span> <span class=”editcomment”><?php edit_post_link(‘Edit’, ”, ”); ?></span><?php if (get_the_tags()) : ?><span class=”taglink”><?php _e(‘Tags:’); ?><?php the_tags(‘ ‘, ‘, ‘, ”); ?></span><?php endif; ?>

    Here is a single page url: https://albereo.com/melanie

    The line “Comments are closed.” appears here at the lower left under the post.

    Yet my interest is in removing the “No Comments” line that appears higher in the meta content just below the post.

    Anyone have a cure or another good idea to play with?

    Thread Starter lucid_design

    (@lucid_design)

    did you manually add this
    ′<span class=”commentlink”><?php comments_popup_link(‘No Comments’, ‘1 Comment’, ‘% Comments’); ?></span> <span class=”editcomment”><?php edit_post_link(‘Edit’, ”, ”); ?>′
    to your single.php?

    Thread Starter lucid_design

    (@lucid_design)

    I don’t see that code in the original single.php, so yes, I did add that code.

    I tried out this theme and everything works for me.

    So, a post on single.php with comments off says ‘Comments are closed.’ without me having to alter even a letter of code.

    The things you added on the single.php is the reason why it’s showing 2 comment statuses. Not sure why the first one says no comments.

    I’d suggest you go back to the original to see if that works and then trace back your steps to see if you didn’t accidentally remove a piece of essential code while customizing this theme.

    Thread Starter lucid_design

    (@lucid_design)

    Peter, great idea. I had modified that code significantly and working backward from the original solved the problem.

    Many thanks for your time and thoughts….

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to remove "no comment" link for posts with closed comments’ is closed to new replies.