• The addy for my blog is http://www.simplerliving.ca/ When a topic is closed for comments, it displays “No comments.” I would like it to say “Closed for Comments.” How do I add this? The theme does not use it’s own comments.php but rather whatever the default is for WP and below is the code from the index, single page, etc. Any help is appreciated.

    <p class=”postmetadata”><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –> | <?php the_tags(‘Tags: ‘, ‘, ‘, ”); ?> Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
    </div><p> </p>

Viewing 15 replies - 1 through 15 (of 22 total)
  • have you tried to actually read the code you pasted ????

    <p class=”postmetadata”><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –> | <?php the_tags(‘Tags: ‘, ‘, ‘, ”); ?> Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
    </div><p> </p>

    …and the slightly more polite version of that last remark is:

    go to this part of the code you posted:

    <?php comments_popup_link('<strong>No Comments</strong> »', '1 Comment »', '% Comments »'); ?></p>

    and where it says ‘No Comments’, change that to ‘Closed for Comments’.

    and the slightly more polite version of that last remark is:

    a simple thank you would have been enough ….

    I am spending HOURS every day for the past two years helping people on these forums, and others , just as other volunteers here are doing .

    But it just seems that sometimes people do not make even the slightest effort to resolve the problems themselves ..

    The forums become overcrowded with fictitious problems that takes a lot of my FREE TIME for (IMHO) nothing …

    So I am sorry if you got offended by how I tried to point out the fact that you did not bother to read the code, while GIVING YOU THE ANSWER, and not ignored your post like others have.
    Maybe I should have known better.

    but going back to the subject, if you want it to be ACTUALLY CLOSED to comments, you should disable the comments on the admin menu (discussion) , either for ALL POSTS on the blog, or on a post-by-post basis when you actually publish .

    your anger is misplaced; please look at who posted what in this thread. i am not the person who asked the original question, i am someone who came to this thread and saw an impatient response that, if i were someone who didn’t know anything about wordpress, would have meant absolutely nothing to me. so i expanded on your response in hopes that it would be slightly more accessible to a beginner.

    your anger is misplaced..i am not the person who asked the original question

    you are right .(although it is hardly ANGER but more close to amazement, astonishment, awe, or bewilderment..) .
    I failed to notice it was a different poster ..
    But none the less, I still stand behind what I wrote about the fact that people must also use common sense before flooding the forums with problems of this kind …. (just like not flagging a post as resolved, not pasting urls for help with themes and css, not posting methods for self-resolved problems etc. etc.)

    We have the CODEX, the SEARCH function on the forum, and there is always Google also if everything else fails .
    But before all these, there is COMMON SENSE, regardless of the actual technical knowledge of WordPress itself.

    if i were someone who didn’t know anything about wordpress, would have meant absolutely nothing to me

    Somehow I think that if one knows ENGLISH good enough to post the question here , one would be able to see the words one was looking for (e.g. – ‘No Comments’) in the code pasted by oneself.

    Said the above , I am very sorry if my answer offended someone, or resembled in any way as ill temper, impatience, antagonist ,intolerant or violent.

    Thread Starter Nyx1961

    (@nyx1961)

    Yes, krembo99, I did read the code I posted. Apparently, however, you did not read my question, but rather just the code.

    The problem is not that it says “No Comments” when a post has no comments, yet is open for comments. I want that. The problem is that it says No Comments when the post is CLOSED for comments. There is a difference between a post being closed for comments and a post having no comments. And even I have the capacity for English and the common sense to see the difference. I did not write the code. It came with the template. And for some reason, the author chose for No Comments to appear on BOTH posts that are closed for comments AND posts that have no comments yet but are open for commenting. That’s great for the latter but not the former.

    I have looked through WordPress for Dummies. I have searched the codex and used common sense. So I mistakenly came here for help. If one could read English well enough, one would see that what I am asking about is a post that I am choosing to keep CLOSED for comments, which is entirely different from a post being OPEN to comments but having none yet, hence NO COMMENTS.

    If I change the No Comments to Closed for Comments, as suggested, by yaysloths then it will appear that posts that are open to comments but have none yet are closed for commenting. I have learned something here though, and that is not to ask for assistance here. Thank you all so much for your kind help. I can’t tell you how much it is appreciated.

    First of all,

    have learned something here though, and that is not to ask for assistance here

    I am very sorry if this is the case… This was not at all my intention to offend someone by replying to a post, and like I said,I am sorry if you got offended somehow…

    ..So I mistakenly came here for help

    You did not came to the wrong, You came to the right place for help, (and in fact, on the front page of this “place” there is a seach field and links to FAQ,CODEX,etc..)

    but ,

    I have searched the codex..

    From the CODEX :

    <?php comments_popup_link( 'No comments yet', '1 comment', '% comments so far', 'comments-link', 'Comments are off for this post'); ?>

    Parameters

    zero
    (string) Text to display when there are no comments. Defaults to ‘No Comments’.
    one
    (string) Text to display when there is one comment. Defaults to ‘1 Comment’.
    more
    (string) Text to display when there are more than one comments. ‘%’ is replaced by the number of comments, so ‘% so far’ is displayed as “5 so far” when there are five comments. Defaults to ‘% Comments’.
    CSSclass
    (string) CSS (stylesheet) class for the link. This has no default value.
    none
    (string) Text to display when comments are disabled. Defaults to ‘Comments Off’.

    Thread Starter Nyx1961

    (@nyx1961)

    Thank you krembo99 for the apology. I can’t imagine anyone not being offended by the responses you gave as well as the tone of them.

    In any case, I already had looked at the part of the codex you indicated above (as well as all the links at the bottom of the page) and tried to implement that bit of code but it did not change anything with regards to the No Comments for both types of comments, which is why I posted here, copied the only code I could find in the theme that pertains to the comments popup and mentioned the fact that the theme uses whatever WP defaults to because something isn’t working properly somewhere between the theme and the WP defaults. If it was, comments that are closed for commenting would be indicated as such (Closed for Comments) and comments that are open for commenting but have none yet would also be indicated as such (No Comments).

    I am able to change the text in the theme’s comment popup but again, that doesn’t solve the problem because no matter what I change No Comments to, it will still erroneously apply to both closed for comments posts and open for comments posts with no comments.

    I’ve tried adding my own comments.php to the theme but it did not override what is in the theme and obviously, my experience with WordPress is limited to the one month I’ve been using it so I am at a loss.

    The current first post on my blog is closed for commenting while the following ones are not yet they all say No Comments and nothing I’ve done to change the obvious (to me) theme code has changed anything. I searched WordPress for Dummies for answers, searched the codex, this forum and Google before posting my question but to no avail. So now I am still stumped.

    I can’t imagine anyone not being offended by the responses you gave as well as the tone of them.

    Krembo99 is a very dedicated helper, and maybe you had the bad luck catching him on a bad day. but my experiences with his answers never struck me as offending.

    Apparantly the code written above is not enough: You need to embed the code in an if statement:

    Hide Comment Link When Comments Are Deactivated
    
    Hides the paragraph element <p></p> that contains the comments_popup_link when comments are deactivated in the Write>Post screen. Good for those who want enable/disable comments post by post. Must be used in the loop.
    
    <?php if ( comments_open() ) : ?>
    <p>
    <?php comments_popup_link( 'No comments yet', '1 comment', '% comments so far', 'comments-link', 'Comments are off for this post'); ?>
    </p>
    <?php endif; ?>

    Peter

    Thread Starter Nyx1961

    (@nyx1961)

    Thank you for your help, Peter. I saw this as well in the codex. However, it entirely hides the comments popup link when comments are disabled. I will use that if I can find no other alternative. But what I’m trying to achieve is for it to say Comments are Closed for this Topic or something similar when the comments are disabled. I do not want to hide it entirely in that instance.

    I have found some code that speaks to that in the WP Comments php (see below) but there is something in the theme coding that is overriding the WP default coding and I’m having difficulty with it because this theme does not have it’s own comments php.

    <?php else : // comments are closed ?>
    		<!-- If comments are closed. -->
    		<p class="nocomments">Comments are closed.</p>

    I had hoped that with the code I pasted in my first post, someone would have been able to advise me as to what I need to add to that code and where I need to add it to get the result I am seeking, for it to say Comments are Off when I disable comments in a post. And yes, I have tried variations of the above comments closed code with only got me a line 20 error message.

    I apologize but I have tried very hard to find this information out for myself before asking here. I have one month experience with WordPress and very little with HTML, CSS, etc.

    you had the bad luck catching him on a bad day

    This was exactly the case …

    In your index.php put this

    <?php if ( comments_open() && pings_open() ) {
    // Both Comments and Pings are open ?>
    <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>
    <?php } elseif ( !comments_open() && pings_open() ) {
    // Only Pings are Open ?>
    Responses are currently closed.
    <?php } elseif ( comments_open() && !pings_open() ) {
    // Comments are open, Pings are not ?>
    <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>
    . Pinging is currently not allowed.
    <?php } elseif ( !comments_open() && !pings_open() ) {
    // Neither Comments, nor Pings are open ?>
    Both comments and pings are currently closed.
    <?php } ?>
    <?php endif; ?>

    instead of this :

    <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>

    notr that you MIGHT need to delete one <?php endif; ?> if it gives you error …

    do that wherever you have the comments (single.php,custom pages, etc..

    you see, the thing is , that wordpress see trackback as comments under some conditions.
    To see what I mean, toggle off the trackbacks and pings options, on the posts that are closed to comments, end voila .. the right text appears.
    WHen opening the trackbacks and pings, even if the comments are closed, wordpress see it as open.
    This is why in the code i pasted they are seperated by an IF condition.

    Thread Starter Nyx1961

    (@nyx1961)

    Thank you very much, Krembo99. I’ll give this a go. I appreciate the help. :o)

    Guys, I want to have an even more complex solution to how to display comments counts and links. I’ll try to explain.

    Post 1: Comments are off on post, don’t want to display “Comments off” instead of a comments link.

    Post 2: Comments are on, comments count and link displayed.

    Post 3: Comments has been on, but is auto off in admin after x days. Want to display comment count and link displayed.

    Is that possible to do with WordPress?

    yes , it is possiable, and you have the solutin written above . (minus the time clock thingie)
    Read a bit here also :http://codex.wordpress.org/Template_Tags/comments_popup_link

    For the time after X days you can use <?php comment_date(); ?> , or <?php comment_time(); ?> with a simple PHP comparison to actual date

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘adding “Comments Closed” to theme’ is closed to new replies.