Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $args = array(
- 'status' => 'approve',
- 'number' => '12');
- $comments = get_comments($args);
- foreach($comments as $comment) {
- $post_id = $comment->comment_post_ID;
- $post_thumb_id = get_post_thumbnail_id($post_id);
- $post_attachment_src = wp_get_attachment_image_src( $post_thumb_id, 'medium');
- $post_thumb_url = $post_attachment_src[0];
- ?>
- <div class="hb-comment" style="background: url('<?php echo $post_thumb_url; ?>');">
- <h5><?php echo($comment->comment_author);?></h5>
- <p><?php echo substr($comment->comment_content,0,50);?></p>
- </div>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement