Support » Themes and Templates » How to display user comments on home page?

  • Hi,

    I want to setup my blog (WP using Smarty tags) so that I have one post on the home page — the latest post. That much I can do easy. But I want any comments posted in response to that post to also show up on the home page.

    Is there a way I can do that somehow?

    I tried various tactics but nothing seems to work.

    My content is displayed via the index.html template where there is a {$content} tag. I tried using an include statement to include the comments.html file, and it gets included all right but it won’t show the user comments.

    Is there some way to use Smarty or inline PHP to get all the comments and display them?

    Any help would be greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
    has a function that may help you. I’m not certain if their “recent comments” can be sorted for a particular article, or not.

    Oh, here’s a rough thought. Can you add the relevent code from wp-comments.php to your index.php? (if it can work, it’ll require some time, no doubt)

    I figured it out. Had to hack out some code from wp-comments, modify it accordingly (add globals, tweak parms, insert HTML, etc), and put it in the posts.html file — plus I had to empty the comments.html file too (except for one line dummy line — can’t be totatlly empty) so that comments didn’t show up twice when viewing posts. Also had to modify the post form, strip out Smarty and put in PHP code.

    Works now. Woooohoo!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to display user comments on home page?’ is closed to new replies.