Dan, I came across your post while looking for the same information. I finally got it! This is the tage you need
<?php comments_template(); ?>
If you want to see the discussion around it see here.
http://wordpress.org/support/topic/68104?replies=8
I hope that does it because I am obviously a newbie as well so I probably can’t help if this isn’t the answer you are looking for.
Hmm, unfortunately that’s not really what I’m trying to do. I’m not looking to add comment functionality to these pages, just to have a count of the comments appear next to the links I’ve incoluded to the five most recent posts.
(@dan_gintis)
17 years, 7 months ago
I’m pretty new to WordPress, so this may be a very simple question…I hope it is.
I’m in the process of creating a new web site that’s centered around a WordPress blog. Aside from the blog, I have about 23 static, non WordPress pages. Every page needs to have in its sidebar a list of the five most recent posts. This I’ve done by changing my HTML pages to PHP, and adding the following code, lifted from a codex page:
<?
ID$news=$wpdb->get_results("SELECT
,
post_titleFROM $wpdb->posts
WHERE
post_status= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
foreach($news as $np){
printf ("<a href=\"..wordpressindex.php?p=%s\">%s</a><BR>", $np->ID,$np->post_title);
}?>
It works great, but I can’t figure out how to add the comment counts to the end of each post title. I’ve done it on the wordpress pages with this
<?php comments_popup_link('[0]', '[1]', '[%]'); ?>
inside the
<?php while (have_posts()) : the_post(); ?>
tags. Any help will be greatly appreciated…go WordPress!