WordPress.org

Ready to get started?Download WordPress

Forums

comments_template() (4 posts)

  1. eddie-miller
    Member
    Posted 5 years ago #

    I would like the comments section to only work in on category of my site.

    Can I limit it's display?

  2. eddie-miller
    Member
    Posted 5 years ago #

    something like

    <?php if (the_category = blog);

    echo ' comments_template(); '

    else

    echo ' '

    ?>

  3. eddie-miller
    Member
    Posted 5 years ago #

    think I got it - but I couldn't work out how to get the

    <?php // comments_template(); ?>

    in the statement so dumped it into another file and called it via a template....

    <?php
    $post = $wp_query->post;
    if ( in_category('3') ) {
    include(TEMPLATEPATH . '/comments_blog_only.php');
    } else {
    echo '';
    }
    ?>

    How can I put <?php // comments_template(); ?> in to the include(TEMPLATEPATH . '/comments_blog_only.php'); ?

  4. moshu
    Member
    Posted 5 years ago #

    This code:
    <?php // comments_template(); ?>
    is commented out = //.
    So it will never do anything, unless you remove the 2 slahes [//].

Topic Closed

This topic has been closed to new replies.

About this Topic