Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show comments on wordpress home page

I've inserted the following code to the template loop (in the correct place), but it is not outputting any comments. Why?

<?php
    $withcomments = true; // force comments form and comments to show on front page
    comments_template( '', true );
?>

I'm trying to display comments for each post on the main-home-page stream of posts.

I'm using the Twenty Ten theme.

like image 314
Dave Avatar asked Jun 01 '11 17:06

Dave


2 Answers

Try this before the <?php endwhile; ?> of the loop in loop.php:

<?php
  $withcomments = "1";
  comments_template();
?>
like image 109
markratledge Avatar answered Sep 23 '22 11:09

markratledge


Try this:

<?php global $withcomments; $withcomments = 1; comments_template(); ?>
like image 39
Huw Rowlands Avatar answered Sep 23 '22 11:09

Huw Rowlands