How to include comments in posts lists?
You can show comments on index.php. Some new themes support this. Also you can add this option to your themes.
Here is the code;
First one you download your theme’s index.php. After that open the file with your favourite text editor and paste this code wher you want to show your comments.
<?php
global $withcomments;
$withcomments = true;
comments_template("/inline-comments.php");
?>
What I did? That’s simple: On line 2, I declare that I’ll use the global variable $withcomments. I then set its value to true on line 3. Finally, I use the comments_template() function to call my comments file. The /inline-comments.php parameter tells the function to use a specific file for displaying comments, instead of the regular comments.php.
That’s All. Have a nice day!
The Original Post!
- Wordpress















Made by Symmetric Web
Distributed by Smashing Magazine
No comments yet!