Support » Requests and Feedback » Display Recent Comments on Static HTML Page

  • Hello

    I am using this code found on this site on my front page to display my 5 latest posts:

    $how_many=5; //How many posts do you want to show
    require_once("nikisiou/wp-config.php"); // Change this for your path to wp-config.php file ?>
    <ol id="whats-new">
    $news=$wpdb->get_results("SELECT <code>ID</code>,<code>post_title</code> FROM $wpdb->posts
    WHERE <code>post_type</code>=\"post\" AND <code>post_status</code>= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
    foreach($news as $np){
    print ("<li><a href=\"");
    echo get_permalink($np->ID);
    print ("\">$np->post_title</a></li>");
    } ?>

    I would like the same thing with the latest comments.

    Anyone feel like coding that ? Thanks in advance =)

  • The topic ‘Display Recent Comments on Static HTML Page’ is closed to new replies.