Forums

[resolved] Closed Comments, Differnet Templates (4 posts)

  1. juneatnoon
    Member
    Posted 4 months ago #

    On my index page, there's a link to the comments popup page. If you are viewing a single page, however, the comments template is right on the page. I have chosen to automatically disable comments after x number of days, and when that happens,

    a) the single page no longer shows the comment form, but it also does not say anything about comments being closed. How do I make it say that?

    b) the index page still has a link to the comments popup, which still has a form available for comments. How do I change that?

    Thanks.

  2. esmi
    Member
    Posted 4 months ago #

    a) Try adding <?php if('open' == $post->comment_status) : ?> before the comment form markup and <?php endif;?> after the form markup in comments.php.

    b) Change <?php comments_popup_link( [...] ); ?></p><?php endif;?> to
    <?php if('open' == $post->comment_status) : ?><p class="comment_link"><?php comments_popup_link( [...] ); ?></p><?php endif;?> in index.php

  3. juneatnoon
    Member
    Posted 4 months ago #

    Thank you. It looks to me like that text IS written in my comments coding, though.... And I think that just results in having no comment form AND being unable to read any of the previous comments. There's only a note saying they're closed. What I want it to look like is this: When comments are automatically closed, you can still read any previous comments left, but there is now a notice indicating that no further comments can be made. Instead, all the previous posts are listed (as I want), but there is no indication that comments are now closed. Does that make sense?

    Also, out of curiosity, do you know why the automatic closing just results in the lack of a comment form with previous comments displayed, yet if I manually disable comments it will say "comments closed" and not display previous comments? Is there a difference between the automatic closing and the manual disabling?

    (BTW, I've decided not to use a popup window, so now I'm just dealing with the comments.php file.)

  4. juneatnoon
    Member
    Posted 4 months ago #

    Ok, after puzzling for hours I've figured it out. I had to add a <?php else ... to my comment form and fiddle around with the placement of the <? php if ... related to no comments, but now it's working just like I want it. Thanks!

Reply

You must log in to post.

About this Topic

Tags

No tags yet.