Skip to content

Instantly share code, notes, and snippets.

@rogerdudler
Created August 15, 2011 08:35
Show Gist options
  • Save rogerdudler/1145905 to your computer and use it in GitHub Desktop.
Save rogerdudler/1145905 to your computer and use it in GitHub Desktop.
recentcomment.phtml
<?
/**
* @see http://codex.wordpress.org/Function_Reference/get_comments
*/
?>
<!-- DYNAMIC:WORDPRESS -->
<h3><?= $title ?></h3>
<a class="feed" href="<?= $feed ?>">Kommentare als RSS</a>
<ul class="recentcomments">
<? foreach($comments as $comment) { ?>
<li>
<a href="<?= esc_url(get_comment_link($comment->comment_ID)) ?>">
<span class="author"><?= $comment->comment_author ?>:</span>
<?= substr(strip_tags($comment->comment_content),0,40) . '...' ?>
</a>
</li>
<? } ?>
</ul>
<!-- STATIC -->
<h3>Titel</h3>
<a class="feed" href="#feed-link">Kommentare als RSS</a>
<ul class="recentcomments">
<li>
<a href="#comment-link">
<span class="author">Hans Muster:</span>
Kommentarinhalt
</a>
</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment