» Plugin: Customizable Post Listings « « Blog Archive coffee2code.com hat bei mir immer super funktioniert.
Aber man kann es auch hartcodiert machen.
PHP
<ul>
<?php $comments = $wpdb->get_results("SELECT comment_post_ID, comment_author, comment_author_email, comment_content, comment_date, DATE_FORMAT(comment_date,'%d.%m.%Y %H:%i') AS new_comment_date
FROM $wpdb->comments
WHERE comment_type = ''
&& comment_approved = '1'
ORDER BY comment_date
DESC LIMIT 5"); ?>
<?php foreach($comments as $comment) {
$post = get_postdata($comment->comment_post_ID); ?>
<li>
<?php echo $comment->comment_author; ?> am<br />
<?php echo $comment->new_comment_date; ?> zu<br />
<a href="<?php echo get_permalink($post['ID']); ?>" title="<?php echo $post['Title']; ?>">
<?php echo $post['Title']; ?></a></li>
<?php } ?>
</ul>
Alles anzeigen