WordPress.org

Ready to get started?Download WordPress

Forums

Loop for Popular Post Title and Thumbnail Display (3 posts)

  1. Andy Scherer
    Member
    Posted 2 years ago #

    Hey Ya'll,

    I'm attempting to implement a popular post loop that displays both the post title and thumbnail. Here is what I have so far:

    [code moderated - please use the pastebin]

    Any help would be greatly appreciated!

  2. Andy Scherer
    Member
    Posted 2 years ago #

    Sorry..trying this code again...

    <ul style="width=640px; list-style-type:none;">
    <?php
    $result = $wpdb->get_results("SELECT comment_count,ID,post_title, post_date FROM $wpdb->posts WHERE post_date BETWEEN '2010-01-01' AND '2011-12-31' ORDER BY comment_count DESC LIMIT 0 , 8");

    foreach ($result as $topten) {
    $postid = $topten->ID;
    $title = $topten->post_title;
    $commentcount = $topten->comment_count;
    if ($commentcount != 0) {
    ?>
    <li style="font-size:11px; float:left; height:225px; margin: 10px 5px 10px 5px; padding: 0 0 0 0; width:140px;">"><?php echo $title ?> (<?php comments_number( '0', '1', '%' ); ?>)
    <?php }
    }
    ?>

  3. Andy Scherer
    Member
    Posted 2 years ago #

    bump...truly need help with this if you could.

Topic Closed

This topic has been closed to new replies.

About this Topic