Retrieve comments from current post using SQL

Send your post id in the function and it will look something like this <?php function dp_recent_comments_ajax($ID) { $no_comments = 5; $comment_len = 300; global $wpdb; $request = “SELECT * FROM $wpdb->comments”; $request .= ” JOIN $wpdb->posts ON ID = comment_post_ID”; $request .= ” WHERE comment_approved = ‘1’ AND post_status=”publish” AND post_password =””; $request .= … Read more

Disable comments

(copied from comment above, so that this question will get an answer): You can try http://wordpress.stackexchange.com/a/89238/26350 if you want to disable comments but still want to have the comment form visible. – birgire Oct 24 ’13 at 1:46

How to check for specific content in comments in the loop

I’ve answered my own question with some more reading and some messing around… I had to run a ‘foreach’ that cycles through the given post’s comments within the main loop. The following code looks at all the comments for each post that passes through the loop and checks for a specific string in the comments’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)