WordPress.org

Ready to get started?Download WordPress

Forums

tabbed "most popular posts" page template ! (1 post)

  1. yashmistrey
    Member
    Posted 2 years ago #

    hi
    i created a "most popular posts" page tamplate
    you can use it from here
    i used jquery tab content, two tabs are :
    1 - most viewed posts
    2 - most commented posts

    one bug in this template !
    if you can solve my problem,
    my tab not working when i use this code

    <?php $result = $wpdb->get_results("SELECT * FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 9");
    foreach ($result as $post) {
    setup_postdata($post);
    $postid = $post->ID;
    $title = $post->post_title;
    $commentcount = $post->comment_count;
    if ($commentcount != 0) { ?>

    when i replaced <?php $result = $wpdb->get_results("SELECT * FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 9");

    to

    <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 10");
    it working but post excerpts not showing ... what can i do ?

    i want to show "post excerpts"

    i tried all <?php the_excerpt(); ?> excerpts code but failed to get excerpt

    please help !!

Topic Closed

This topic has been closed to new replies.

About this Topic