• hi i want to show the name of last author that send comment in the each post
    may i help me how can do that ?
    for example in one of my post have 20 comment
    that author name that send comment is
    andreas
    rami
    ……
    kits
    Michal

    so i want show the name of latest comment author in my theme for this ppst
    in this sample i have to show name of Michal

Viewing 1 replies (of 1 total)
  • Thread Starter kits

    (@kits)

    hi
    i use this code ,i want put this code to index above every post to show last comment author name for each post above each post
    so how can change *** to post id function

    <?php
    $args = array(
    	'status' => 'approve',
    	'number' => '1',
    	'post_id' => ***, // use post_id, not post_ID
    );
    $comments = get_comments($args);
    foreach($comments as $comment) :
    	echo( $comment->comment_author);
    endforeach;
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘latest name of author commnter for each post’ is closed to new replies.