WordPress.org

Support

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

[Resolved] Hide comments box on certain category posts

  • 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)
  • Try using <?php if (in_category('x')) : ?>

    adilomar

    @adilomar

    wow thanks man worked like a charm!

    ipunkbali

    @ipunkbali

    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 ‘[Resolved] Hide comments box on certain category posts’ is closed to new replies.
Skip to toolbar