functions – How to put the AVATAR and URL (buddypress profile) of the commenter in the wordpress post?

Question

I need to put the AVATAR and the URL (buddypress profile) of the commenter. I’ve searched in several places and I can’t find the solution.

EXAMPLE:

AVATAR USER [a href=”URL-PROFILE-BUDDYPRESS“]Rachel[/a] [06/03/21] : Commented in the post “How to be a Web Designer”, written by: Postage Author – Test Comment

  <?php
  $args = array(
        'user_id' => bp_current_user_id(),
        'number' => 20, // how many comments to retrieve
        'status' => 'approve'
        );

    $comments = get_comments( $args );

    if ( $comments )
    {
        $output.= "<ul>n";
        foreach ( $comments as $c )
        { 
        $output.= '<li>';
        $output.= $post_author_id;
        $output.= $c->comment_author;
        $output.= ' [';
        $output.= mysql2date('d/m/y', $c->comment_date, $translate);
        $output.= '] ';
        $output.= ' : ';
        
        $output.= '<a href="'.get_comment_link( $c->comment_ID ).'">';
        $output.= get_the_title($c->comment_post_ID);
        $output.= "</a>";
        $output.= ' oferecida por  ';
        $output.= '<b>';
        $output.= get_the_author_meta( 'display_name', get_post_field( 'post_author', $c->comment_post_ID ) );
        $output.= '</b>';
        $output.= ' - ';
        $output.= $comment->user_id;
        $output.= $c->comment_content;
        $output.= "</li>n";
        
        }
        $output.= '</ul>';

        echo $output;

        
    } else { echo "No comments made";}
?>

0
Patrique Uiliam 2 months 2021-06-04T18:58:44-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse