It should be. Check the WP codes dev docs functions page for category functions, you would need one that returns a posts category then you could run an if not this category display comment reply form
https://codex.wordpress.org/The_Loop#Style_Posts_From_Some_Category_Differently
@rossagrant – these Codex pages on the loop are your ‘bread and butter’ when theming with WordPress blogs.
in single.php something like this should work:
`<?php if( ! in_category('exclude') )
comments_template(); ?>`
where you change exclude to the name or id of the category you don’t want the comments to show up.
There you go that is the approach written for you, however do check the codex and docs because they are written for a purpose, to help with this sort of request, quick check there first, will likely get you halfway to a solution we can then fill the rest in if necessary.
@travel-junkie
Thanks so much for the code, i’ve just given it a try but I’m getting a blank page when trying to look at the post’s page.
<?php if( ! in_category('61') )
comments_template(); ?>
Category 61 is the one I want to disable comments on so I used the above code. Is that all I needed to put in single.php or is there anything else?
Sorry for sounding so crap, but… I am!
Oh yeah, any progress on the CV plugin? Can’t wait to start using it!
Thanks
@hnla @rogercoathup Thanks for your help here too guys!
How did you write it as the category name? as travel-junkie shows? it should work on a single post page in or outside the loop.
Blank page suggests a critical error in php syntax somewhere.
You might need to show the snippet of code you added
Well, you probably want to adjust all the index files like index.php, archive.php or category.php as well, so the comment count doesn’t show up there when the post is in that category. When you use the category ID then you need to get rid of the enclosing ‘.
So that would be
`<?php if( ! in_category( 61 ) )
comments_template(); ?>`
The jobboard plugin is quite stable now and I’ll release that soon, so shortly after that I’ll work on getting the CV component ready.