function dp_recent_comments() {
$comment_len = 80;
$comments = get_comments('number=5');
if ($comments) {
foreach ($comments as $comment) {
?>
<li>
<span class="thumb"><?php echo get_the_post_thumbnail( $comment->comment_post_ID, 'thumbnail' ); ?></span>
<span class="post-comment-link"><?php echo get_the_title( $comment->comment_post_ID ); ?></span>
<span class="author"><a href="<?php echo get_comment_author_url( $comment->comcomment_ID); ?>"><?php echo $comment->comment_author; ?>:</a></span>
<span class="time"><?php echo get_the_date( 'd M Y, H:i', $comment->comment_post_ID ); ?></span>
<span class="comment-text"><?php echo strip_tags(substr(apply_filters('get_comment_text', $comment->comment_content), 0, $comment_len)); ?>...</span>
</li>
<?php
}
} else {
echo "<li>Комментарии отсутствуют</li>";
}
}
<script>
function toggleVideo(state) {
// if state == 'hide', hide. Else: show video
var div = document.getElementById("popupVid");
var iframe = div.getElementsByTagName("iframe")[0].contentWindow;
div.style.display = state == 'hide' ? 'none' : '';
func = state == 'hide' ? 'pauseVideo' : 'playVideo';
iframe.postMessage('{"event":"command","func":"' + func + '","args":""}', '*');
}
</script>
<p><a href="javascript:;" onClick="toggleVideo();">Click here</a> to see my presenting showreel, to give you an idea of my style - usually described as authoritative, affable and and engaging.</p>
<!-- popup and contents -->
<div id="popupVid" style="position:absolute;left:0px;top:87px;width:500px;background-color:#D05F27;height:auto;display:none;z-index:200;">
<iframe width="500" height="315" src="http://www.youtube.com/embed/T39hYJAwR40?enablejsapi=1" frameborder="0" allowfullscreen></iframe>
<br /><br />
<a href="javascript:;" onClick="toggleVideo('hide');">close</a>