Support » Plugins and Hacks » Hide comments box on certain category posts

  • Resolved adilomar

    (@adilomar)


    hi guys,
    iam trying to hide the comments box on certain category, so the user cannot comment on the posts which fall in that category
    i tried
    ‘<?php if (is_category(‘x’)) : ?>
    <?php else : ?>
    <?php comments_template(); ?>
    <?php endif; ?>’

    buts its not working, anyone got solution for this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Forum Moderator

    Try using <?php if (in_category('x')) : ?>

    wow thanks man worked like a charm!

    I wanna do the same thing, hiding comment box on certain category.

    But I cant find this code to change
    ‘<?php if (is_category(‘x’)) : ?>
    <?php else : ?>
    <?php comments_template(); ?>
    <?php endif; ?>’

    Where do I find it? thanks

    You may have figured it out by now, but it’s in the Single Post template (single.php) toward the bottom. Paste the above code in place of <?php comments_template(); ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide comments box on certain category posts’ is closed to new replies.