bongzilla

Untitled

Feb 10th, 2021
98
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $comments_query = new WP_Comment_Query;
  3. $comments = $comments_query->query( 'status=approve&number=10' );
  4. if ( $comments ) {
  5. foreach ( $comments as $comment ) { ?>
  6. <a href="<? echo get_permalink($comment->comment_post_ID) ?>" title="Статья <? echo get_the_title($comment->comment_post_ID) ?>">
  7. <p class="<? if ($comment->user_id == 1) { echo 'author';} else {echo 'reader';} ?>"><? echo $comment->comment_author . ": " . $comment->comment_content; ?></p></a>
  8. <? }}; ?>
  9.  
RAW Paste Data