| name | language | licence |
|---|---|---|
| Template Name | PHP | BSD |
| Dynamic Title Tags | PHP | BSD |
| Display Top Comments | PHP | BSD |
| Display Archives | PHP | BSD |
| Display Recently Updated Posts/Pages | PHP | BSD |
| Customizing flickrRSS | PHP | BSD |
| Scrobbler | PHP | BSD |
| Display WordPress Tags Cloud | PHP | BSD |
< 1 2 3 4 5 6 7 8 9 >
language: PHP
licence: BSD
Display Top Comments
options: view full snippet • send to code collector
Display Top Comments
<?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 10");
foreach ($result as $topten) {
$postid = $topten->ID;
$title = $topten->post_title;
$commentcount = $topten->comment_count;
if ($commentcount != 0) { ?>
<li><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>"><?php echo $title ?></a></li>
<?php } } ?>



library
buttons (3)
wp (93)