Support » Themes and Templates » How to put comments on the main (index.php) page?

  • 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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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?

    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?

    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(); ?>

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


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to put comments on the main (index.php) page?’ is closed to new replies.