I have this code :-
function retrieve_comments(){
$myPost = $_REQUEST['post_id'];
$output = get_comments('post_id='.$myPost);
if(is_array($output)){
$response['output'] = $output;
foreach($response['output'] as $comment) :
echo($comment->comment_author . '<br />' . $comment->comment_content);
endforeach;
}
else{
echo $output;
}
die;
};
This code return me in console this :
auther name <br /> comment of the post
Now , How can print it in single.php