the goat
01-21-2009, 11:37 PM
It might be getting to the point where wordpress needs its own sub forum.
Well here is my latest pet peeve. I have one site where there are lots of members who like to comment, it has almost reached social network levels. One of them brought it to my attention that you can not access comments from certain navigation points.
For instance if you search for a post, or if you link to it from the archives you can neither see nor add to the comments. I have remedied it, but only halfway. I was hoping to have any post always display the comments and the comment box by adding this code to the archive.php and search.php files:
<?php comments_template(); ?>
When that didn't work I tried to see if I could at least get the amount of previous comments display so there would at least be a link there. To my surprise this did work. Here is the code:
<?php comments_popup_link('Comment', '1 Comment', '% Comments'); ?>
I put that inside both the search.php and the archive.php files directly under this existing code:
<div class="category"><?php the_category(', '); ?> </div>
This way no matter how someone finds a post they can still comment on it.
I have no idea if this is the best way to do it, but I thought I would post it in case anyone else had a site that comments were popular on. I found that my category links all direct to the archives, so even new posts were sometimes being seen with no way to comment. Hopefully someone finds it useful.
Well here is my latest pet peeve. I have one site where there are lots of members who like to comment, it has almost reached social network levels. One of them brought it to my attention that you can not access comments from certain navigation points.
For instance if you search for a post, or if you link to it from the archives you can neither see nor add to the comments. I have remedied it, but only halfway. I was hoping to have any post always display the comments and the comment box by adding this code to the archive.php and search.php files:
<?php comments_template(); ?>
When that didn't work I tried to see if I could at least get the amount of previous comments display so there would at least be a link there. To my surprise this did work. Here is the code:
<?php comments_popup_link('Comment', '1 Comment', '% Comments'); ?>
I put that inside both the search.php and the archive.php files directly under this existing code:
<div class="category"><?php the_category(', '); ?> </div>
This way no matter how someone finds a post they can still comment on it.
I have no idea if this is the best way to do it, but I thought I would post it in case anyone else had a site that comments were popular on. I found that my category links all direct to the archives, so even new posts were sometimes being seen with no way to comment. Hopefully someone finds it useful.