Created
June 18, 2015 05:34
-
-
Save rafsuntaskin/7fadc022a018317ff427 to your computer and use it in GitHub Desktop.
Get last comment for a wordpress post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$PostID = 215; | |
global $wpdb; | |
$p = $wpdb->prefix; | |
var_dump($wpdb->get_results($wpdb->prepare("SELECT comment_date FROM {$wpdb->prefix}comments WHERE comment_post_ID = %d ORDER BY comment_date DESC LIMIT 1",$PostID))); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment