Created
April 14, 2016 23:25
-
-
Save feliciaceballos/3346cb7b144d30a3f7c59631750881b4 to your computer and use it in GitHub Desktop.
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