Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm working with a client who wants visitors to be able to post comments on categories instead of on individual posts, but I am unsure on how to go about it. Is it possible to display the comment form in a category? Just pasting in <?php comments_template(); ?> didn't do it, unfortunately.

share|improve this question

migrated from stackoverflow.com Jun 12 '12 at 13:35

This question came from our site for professional and enthusiast programmers.

    
I assume you are pasting it under "category.php" ....will it be possible if u show the code that where you are placing this chunk of code –  swapnesh Jun 12 '12 at 9:06
    
Sure, here it is: pastebin.com/D4KZEMcp –  Anders Norén Jun 12 '12 at 9:23
    
Place <?php comments_template(); ?> right above the <?php endwhile; ?> --this is somewhere around line 79 and let me now if it works or not –  swapnesh Jun 12 '12 at 9:27
    
Sorry, didn't work. Also, wouldn't that connect the comments form to the posts in the category? I don't want the comments to be connected to the posts in the category, but to the category itself. –  Anders Norén Jun 12 '12 at 9:36

2 Answers 2

For all I know, that's not possible, since comments depend on a Post ID to exist.

You can, however, mimic that functionality by registering a post_type to be at the same time, attached to one specific category, and parent their comments.

Then you can insert a secondary query on your comments.php to fetch the post_type entry associated with the current category and display its comments by that category's posts.

share|improve this answer

i have found this answer here tried it and it worked for a clean template i expriment on

here is the code:

<?php
$wp_query->is_single = true;
comments_template('/comments-slide.php');
$wp_query->is_single = false;
?>

.
Hope this helps... Sagive

p.s - i would read the original answer to learn more

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.