WordPress.org

Support

Support » How-To and Troubleshooting » tabbed "most popular posts" page template !

tabbed "most popular posts" page template !

  • yashmistrey
    Member

    @yashmistrey

    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 !!

  • The topic ‘tabbed "most popular posts" page template !’ is closed to new replies.