Allow comments in categories
URL to the page in question:
-
Hello
Is it possible to allow comments but only in one category (like Blog)?
David,
Interesting idea. You can do that using WordPress’ built in conditional tags. Here’s how:
- Go to the appearance section and select edit to open up the theme editor.
- From the list of files on the right, choose single.php and look for this spot:
<?php comments_template('',true); ?>
- Replace that with this:
- Change
Your Category
to the name of the category where you’d like to have your comments available
- Save your changes.
That should do it. If you have any questions or trouble, let me know.
Thank you for your business,
Bill
David,
Could you post the code you ended up with at http://gist.github.com and then enter the link to it back here so I can a look at it?
Thanks,
Bill
- The topic ‘Allow comments in categories’ is closed to new replies.