how to disable comments links on comments.php
-
I am setting up a blog that will have commenting disabled for most posts. I’ve installed Smart Comments Plugin V. 2.0 (laihiu.nicesoda.com/2005/11/01/post378) and that is dealing nicely with the index.php
I’ve just spent a fair amount of time figuring out how to get rid of any mention of comments in comments.php for posts that have comments disabled. There are a number of posts that talk about how to do this on the index.php of the theme folder but I have been unable to find anything about altering comments.php. After staring at the various smart comments fixes for index.php, I finally came up with something that isn’t too horrible, although it’s probably code heavy… (I outlined what I did at the end of this voluminous post)
There is only one thing left to implement but not really knowing that much about php, I have no idea how to go about it: there may be cases that comments are enabled for a time and then disabled. How do I place a note saying “comments are now closed” on those posts? (I hope my question made sense.
-ejm
P.S. This is what I’ve done so far:
In themes/Classic/comments.php I FOUND
<?php else (comments_open()) : // If there are no comments yet ?>
<p><?php _e('No comments yet.'); ?></p>
<?php endif; ?>and REPLACED it with the following:
<?php elseif (comments_open()) : // If there are no comments yet ?>
<p><?php _e('No comments yet.'); ?></p>
<?php else : // If comments disabled ?>
<?php endif; ?>I FOUND
<?php else : // Comments are closed ?>
<p><?php _e('Comments are closed.'); ?></p><?php endif; ?>
and REPLACED it with the following:
<?php elseif ( comments_open() ) : // Comments are closed ?>
<p><?php _e('Comments are closed.'); ?></p>
<?php else : // Comments are disabled ?>
<?php endif; ?>
- The topic ‘how to disable comments links on comments.php’ is closed to new replies.