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

  1. manuman
    Posted 2 years 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">
    //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(); ?>

    [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.]


  2. manuman
    Posted 2 years 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?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • SEO Facebook Comment
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic