Last active
March 22, 2017 13:16
-
-
Save chinmayrajyaguru/e36d6dcda45c52c2f61cd47c3d61e8c9 to your computer and use it in GitHub Desktop.
WordPress Approved Recent Comments with Gavtar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Recent Comments</h3> | |
<ul class="recent-comment"> | |
<?php | |
$comments =get_comments( array('number'=>'5', 'status' => 'approve') ); | |
foreach($comments as $comm) : | |
$url = '<a href="'. get_permalink($comm->comment_post_ID).'#comment-'.$comm->comment_ID .'" title="'.$comm->comment_author .' | '.get_the_title($comm->comment_post_ID).'">' . $comm->comment_author . '</a>'; | |
?> | |
<li> | |
<?php echo get_avatar($comm->comment_author_email, 30); ?> | |
<strong><?php echo $url; ?></strong> | |
<p><?php echo $comm->comment_content; ?></p> | |
</li> | |
<?php | |
endforeach; | |
?> | |
</ul> | |
/* | |
.recent-comment li { | |
display: block; | |
border-bottom: 1px dotted #ccc; | |
} | |
.recent-comment .avatar-30 { | |
float: left; | |
margin-right: 10px; | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment