Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feliciaceballos/3346cb7b144d30a3f7c59631750881b4 to your computer and use it in GitHub Desktop.
Save feliciaceballos/3346cb7b144d30a3f7c59631750881b4 to your computer and use it in GitHub Desktop.
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