WordPress.org

Ready to get started?Download WordPress

Forums

comments directly under post - everytime (3 posts)

  1. tobsen
    Member
    Posted 8 years ago #

    Hi,

    I would like to see the comments to a post directly under the post, even in the "list"-view, where I can see 10 posts or so.
    At the moment I have to click to "comments (x)" on everey post, thats not very useful.

    PS: our blog is a internal tech-blog for "virtual meeting". so other members put there perception to the post in the comments, and they are usually as important as the post itself.

    thx!

  2. Kafkaesqui

    Posted 8 years ago #

    In your theme's index.php template, change the call to comments_template() to this (or add if it doesn't exist):

    <?php
    $wp_query->is_single = true;
    comments_template();
    $wp_query->is_single = false;
    ?>

    This temporarily sets the template/page query type to single. The comments_template() function tests on this to decide if the comments template should be included, so we're fooling it here.

    You'll probably want to remove the comments_popup_link() template tag as well (or comments_link()), which is what displays your comments (N) link.

  3. tobsen
    Member
    Posted 8 years ago #

    I played a little bit with the position of the function, but at the end it works quit fine.
    That's what I was looking for, big THANKS!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.