comments closed error (2 posts)

  1. eddai
    Posted 5 years ago #

    hi all..
    I'm trying to display random posts under each posts before comments area with thumbnails..
    but the query I've written causes an error that it makes comments functionality disabled and it returns "Comments Closed" warning..

    I can't figure out what causes of this..following is the query

    $randompost = $wpdb->get_results("SELECT p.ID
    FROM wp_terms INNER JOIN wp_term_taxonomy ON wp_terms.term_id = wp_term_taxonomy.term_id
    INNER JOIN wp_term_relationships wpr ON wpr.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
    INNER JOIN wp_posts p ON p.ID = wpr.object_id WHERE taxonomy = 'category'
    AND p.post_type = 'post' AND wp_terms.name = 'Movie' AND p.post_status = 'publish'
    ORDER BY RAND( ) LIMIT 3 ");

    this is not the full code just the sql query..when I just remove this, comments seem to work properly..so this is why I guess this sql query disables comment functionality..

    could u help please ?

    Thanks in advance..

  2. eddai
    Posted 5 years ago #

    still couldn't solve the problem. can not anyone help?

Topic Closed

This topic has been closed to new replies.

About this Topic