Created
April 29, 2016 21:50
-
-
Save feliciaceballos/02c1d8050b60a5586532ec13885f74cb to your computer and use it in GitHub Desktop.
Show Most Recent Comment
This file contains 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
function show_most_recent_comment($post_id) { | |
$args = array( | |
'number' => '1', | |
'post_id' => $post_id, | |
); | |
$comments = get_comments($args); | |
foreach($comments as $comment) : | |
echo($comment->comment_author . '<br>' . $comment->comment_content. '<br>' .$comment->comment_date); | |
endforeach; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment