| name | language | licence |
|---|---|---|
| timthumb | PHP | GPL 2 |
| Display Top Comments | PHP | BSD |
| Display Archives | PHP | BSD |
| Display Recently Updated Posts/Pages | PHP | BSD |
| Untitled Snippet | PHP | Other |
| blog | PHP | Other |
| compressed.css | PHP | Other |
| Template Tags/wp list bookmarks | PHP | Other |
< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 >
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)