• Resolved pixelbytesmedia

    (@pixelbytesmedia)


    I am manually outputting user specific recent comments on author pages and I wasn’t sure how to output the image in my code. I currently have the following in my author template file, which lists the post title (with a link to the comment), the comment itself, and the comment post date. How can I output a thumbnail of the image with the zoom feature?

    $author = get_query_var( ‘author’ );
    $author = get_user_by( ‘id’, $author );

    $args = array(
    ‘user_id’ => $author->ID,
    ‘number’ => 10, // how many comments to retrieve
    ‘status’ => ‘approve’
    );

    $comments = get_comments( $args );

    if ( $comments )
    {
    $output.= “

      \n”;
      foreach ( $comments as $c )
      {
      $output.= ‘

    • ‘;
      $output.= ‘<h4>comment_ID ).'”>’;
      $output.= get_the_title($c->comment_post_ID).’
      </h4>’;
      $output.= ‘<p>’.$c->comment_content.'</p>’;
      $output.= ‘<span class=”pro-comment-date”>Posted on: ‘. mysql2date(‘m/d/Y’, $c->comment_date, $translate).'</span>’;
      $output.= “
    • \n”;
      }
      $output.= ‘

    ‘;

    echo $output;
    } else { echo “No reviews made recently”;}

Viewing 1 replies (of 1 total)
  • Plugin Author WP Puzzle

    (@wppuzzle)

    Hello!
    You should use in code get_comment_text( $c->comment_ID ) instead of $c->comment_content

Viewing 1 replies (of 1 total)
  • The topic ‘Manually Display Images’ is closed to new replies.