It is very common and easy to setup your wordpress site’s homepage with the latest post including comments on home page of your website.
Here is how you can do it.
No matter which wordpress theme you are using. All themes usually have single.php file in there. Simply copy the file and rename it to LatestPost.php
Now open that new file and add this code on very top of it.
1 2 3 4 5 |
<?php /* Template Name: LatestPost */ ?> |
The above code makes a page template in your theme. The name we assigned to this template is LatestPost, off course you can rename it to whatever you like.
Now find the below code in LatestPost.php file
1 2 3 |
<?php comments_template(); ?> |
The above code actually creates the template for comments and populates all comments submitted under the post.
So now, right above the code, put this code
1 |
$withcomments =1; |
So it should like the below code sample.
1 2 3 4 |
<?php $withcomments =1; comments_template(); ?> |
$withcomments =1; actually makes your homepage to accept comments and also it will list comments submitted so far on your post.
I hope this will be helpful for you people.