Archive for the ‘index’ tag
WordPress: Force full comment display on archives or index page
April 21st, 2009 at 12:37 pm
By default, most themes are written so that archive or index pages (pages that display multiple posts) show how many comments have been approved, and the reader must click a link to see the actual comments, usually with the result of opening the specific post. This is for good reason, for on a site with a large number of comments on many posts, display of the pages would become unwieldly.
One client, however, wanted all post comments to appear fully visible on his archive/index page. This required some theme tinkering, with a change in which php function was called. The solution, as described by Flisterz, was simple:
I added this to the second line of “archive.php” (not to be confused with “archives.php”), right after the "get_header" line:
<?php $withcomments = 1 ?>
And I added this to the same file, right before the end of the loop:
<?php comments_template(); ?>
Some optional cleaning up was done, to eliminate the old comment code and place tags in the most beneficial spot, but otherwise, that did it.
