WordPress.org

Ready to get started?Download WordPress

Forums

SEO Facebook Comment
Why is not showing the last 5 comments (2 posts)

  1. manuman
    Member
    Posted 7 months ago #

    I have this code which shows the last 5 comments. Since the plugin is actually importing the facebook comments on my DB. Why is not working this script?

    <div class="tabs-post">
    
    <?php
    //show recent comments
    $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type, comment_author_url, SUBSTRING(comment_content,1,70) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 5";
    $comments = $wpdb->get_results($sql);
    foreach ($comments as $comment) :
    ?>
    <div class="tab_inside">
    <a>ID); ?>#comment-<?php echo $comment->comment_ID; ?>"><?php echo get_avatar( $comment, '53' ); ?></a>
    <div class="content"><h1><a>ID); ?>#comment-<?php echo $comment->comment_ID; ?>"><?php echo $comment->post_title; ?></a></h1>  <span class="date"><?php echo strip_tags($comment->com_excerpt); ?></span></div><!-- #content closer -->
    </div><!-- #tab_inside -->
    <?php endforeach; ?>
    <?php wp_reset_query(); ?>
    
    </div>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    http://wordpress.org/plugins/seo-facebook-comments/

  2. manuman
    Member
    Posted 7 months ago #

    It only shows the comments done directly from the WP form or from another plugin which is importing comments from my facebook publications. Why this not?

Reply

You must log in to post.

About this Plugin

About this Topic