How to put comments on the main (index.php) page? (5 posts)

  1. timoni
    Posted 9 years ago #

    According to the Codex:

    you'll need to set the $withcomments variable to "1" before calling this tag.

    Okay, fine. How do I do this?

  2. David Yeiser
    Posted 9 years ago #

    Are you wanting to display the most recent comments across the site? Or do you want to display the associated comments with each post on the front page without having to click on a "Comments" link?

  3. stuntmusic
    Posted 8 years ago #

    I am looking for this functionality as well. My client wants a "comments" link to appear in the main page of the site, something you can click on to leave a comment.

    I've tried to use a PHP call in idex.php, but can't figure out how to dynamically pull the post ID into the page.

    Any hel?

  4. ellagray
    Posted 8 years ago #

    You include <?php comments_template(); ?> in the posts loop and you add <?php $withcomments = TRUE;
    ?> in the same file (index.php in this case). I added it at the top of the page, after <?php get_header(); ?>

  5. henigushi
    Posted 8 years ago #

    You can also combine ellagray's lines:
    <?php $withcomments = true; comments_template();?>


Topic Closed

This topic has been closed to new replies.

About this Topic