本文整理汇总了PHP中comment_class函数的典型用法代码示例。如果您正苦于以下问题:PHP comment_class函数的具体用法?PHP comment_class怎么用?PHP comment_class使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了comment_class函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commentlist
function commentlist($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<li id="li-comment-<?php
comment_ID();
?>
">
<div id="comment-<?php
comment_ID();
?>
" <?php
comment_class('comment_item clear');
?>
>
<div class="comment_meta">Posted on <?php
printf(__('%1$s'), get_comment_date());
?>
by <?php
printf(__('<cite class="fn">%s</cite>'), get_comment_author_link());
?>
</div>
<div class="comment_text"><?php
comment_text();
?>
</div>
</div>
<?php
}
示例2: my_theme_comment
function my_theme_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
switch ($comment->comment_type) {
default:
?>
<li <?php
comment_class();
?>
id="comment-<?php
comment_ID();
?>
">
<p class="meta-comment">
<?php
echo get_avatar($comment, 30);
?>
<span class="author-name"><?php
comment_author();
?>
</span>
<time <?php
comment_time('c');
?>
class="comment-time">
<span class="date">
<?php
comment_date();
?>
</span>
<span class="time">
<?php
comment_time();
?>
</span>
</time>
</p>
<div class="comment-content">
<?php
comment_text();
?>
</div>
<div class="comment-actions">
<div class="reply"><?php
comment_reply_link(array_merge($args, array('reply_text' => 'Reply', 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</div><!-- .reply -->
</div>
<!-- #comment-<?php
comment_ID();
?>
-->
<?php
// End the default styling of comment
break;
}
}
示例3: efreetant_comments
function efreetant_comments($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<div id="comment-<?php
comment_ID();
?>
" <?php
comment_class('comment');
?>
>
<article class="comment">
<header class="comment-author">
<?php
$bgauthemail = get_comment_author_email();
?>
<img data-gravatar="http://www.gravatar.com/avatar/<?php
echo md5($bgauthemail);
?>
?s=40" class="avatar" height="40" width="40" src="<?php
echo get_template_directory_uri();
?>
/images/nothing.gif" />
<?php
printf(__('<cite class="fn">%1$s</cite> %2$s', 'efreetanttheme'), get_comment_author_link(), edit_comment_link(__('(Edit)', 'efreetanttheme'), ' ', ''));
?>
<time datetime="<?php
echo comment_time('Y-m-j');
?>
"><a href="<?php
echo htmlspecialchars(get_comment_link($comment->comment_ID));
?>
"><?php
comment_time(__('F jS, Y', 'efreetanttheme'));
?>
</a></time>
</header>
<?php
if ($comment->comment_approved == '0') {
?>
<div class="alert alert-info">
<p><?php
_e('Your comment is awaiting moderation.', 'efreetanttheme');
?>
</p>
</div>
<?php
}
?>
<section class="comment_content">
<?php
comment_text();
?>
</section>
<?php
comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</article>
<?php
}
示例4: start_el
function start_el(&$output, $comment, $depth, $args, $id = 0)
{
$depth++;
$GLOBALS['comment_depth'] = $depth;
$GLOBALS['comment'] = $comment;
if (!empty($args['callback'])) {
call_user_func($args['callback'], $comment, $args, $depth);
return;
}
extract($args, EXTR_SKIP);
?>
<li id="comment-<?php
comment_ID();
?>
" <?php
if ($depth > 1) {
comment_class('child-comment');
} else {
comment_class();
}
?>
>
<?php
include locate_template('templates/comment.php');
?>
<?php
}
示例5: mytheme_comment
function mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>">
<div class="comment-author vcard">
<span class="small_frame"><?php echo get_avatar($comment,$size='60',$default=get_template_directory_uri().'/images/gravatar.gif' ); ?></span><br />
<cite><?php comment_author_link() ?></cite><br />
<div class="date"><?php comment_date('M d, Y'); ?></div>
</div>
<div class="comment-text">
<?php if ($comment->comment_approved == '0') : ?>
<em class="awaiting_moderation"><?php _e('Your comment is awaiting moderation.', 'epanel') ?></em>
<br />
<?php endif; ?>
<?php comment_text() ?>
<div class="comment-meta commentmetadata">
<?php edit_comment_link(__('(edit)'),' ','') ?>
</div>
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('reply_text' => '(reply)', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
</div>
<?php } ?>
示例6: as_function_comments_better
function as_function_comments_better($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<li <?php
comment_class();
?>
id="as-li-comment-<?php
comment_ID();
?>
">
<div class="as-comment" id="as-comment-<?php
comment_ID();
?>
">
<div class="as-comment-content">
<?php
echo get_avatar($comment, $size = '65');
?>
<div class="as-comment-meta">
<h4><?php
comment_author_link();
?>
<span><?php
comment_date();
?>
at <?php
comment_time();
?>
</span>
</h4>
</div>
<div class="as-comment-text">
<?php
comment_text();
?>
<?php
if ($comment->comment_approved == '0') {
?>
<p style="font-style:italic;"><?php
_e('Your comment is awaiting moderation.', AS_DOMAIN);
?>
</p>
<br />
<?php
}
?>
<?php
edit_comment_link(__('[Edit]', AS_DOMAIN), ' ', '');
?>
<?php
comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</div>
</div>
</div>
<?php
}
示例7: et_custom_comments_display
function et_custom_comments_display($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<li <?php
comment_class();
?>
id="li-comment-<?php
comment_ID();
?>
">
<div id="comment-<?php
comment_ID();
?>
" class="comment-body clearfix">
<div class="avatar-container">
<?php
echo get_avatar($comment, $size = '56');
?>
<span class="avatar-overlay"></span>
</div> <!-- end .avatar-->
<div class="comment-wrap clearfix">
<div class="comment-meta commentmetadata"><?php
printf('<span class="fn">%s</span>', get_comment_author_link());
?>
- <span class="comment-date"><?php
echo get_comment_date();
?>
</span> <?php
edit_comment_link(esc_html__('(Edit)', 'Modest'), ' ', '');
?>
</div>
<?php
if ($comment->comment_approved == '0') {
?>
<em class="moderation"><?php
esc_html_e('Your comment is awaiting moderation.', 'Modest');
?>
</em>
<br />
<?php
}
?>
<div class="comment-content"><?php
comment_text();
?>
</div> <!-- end comment-content-->
<?php
$et_comment_reply_link = get_comment_reply_link(array_merge($args, array('reply_text' => esc_attr__('Reply', 'Modest'), 'depth' => $depth, 'max_depth' => $args['max_depth'])));
if ($et_comment_reply_link) {
echo '<div class="reply-container">' . $et_comment_reply_link . '</div>';
}
?>
</div> <!-- end comment-wrap-->
</div> <!-- end comment-body-->
<?php
}
示例8: stormbringer_comments
function stormbringer_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class('media'); ?>>
<div class="pull-left">
<div class="comment-avatar vcard">
<?php echo get_avatar($comment,apply_filters('stormbringer_author_bio_avatar_size', 100) ); ?>
</div>
</div>
<!-- /.comment-avatar -->
<div class="media-body">
<div class="comment-message">
<?php printf(__('<h4 class="media-heading">%s</h4>','stormbringer'), get_comment_author_link()) ?>
<?php edit_comment_link(__('Edit','stormbringer'),'<span class="edit-comment btn btn-info"><span class="glyphicon glyphicon-pencil"></span>','</span>') ?>
<?php if ($comment->comment_approved == '0') : ?>
<div class="alert-message success">
<p><?php _e('Your comment is awaiting moderation.','stormbringer') ?></p>
</div>
<?php endif; ?>
<?php comment_text() ?>
<time datetime="<?php echo comment_time('c'); ?>"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php comment_time(esc_attr__( 'F j, Y', 'stormbringer' )); ?> <?php _e('at', 'stormbringer'); ?> <?php comment_time(esc_attr__( 'H:i', 'stormbringer' )); ?> </a></time>
</div>
</div>
<!-- /.comment-message -->
<!-- </li> is added by wordpress automatically -->
<?php
}
示例9: king_news_rewrite_comment_item
/**
* A custom function to use to open and display each comment.
*
* @since 1.0.0
* @param object $_comment Comment to display.
* @param array $args An array of arguments.
* @param int $depth Depth of comment.
*/
function king_news_rewrite_comment_item($_comment, $args, $depth)
{
global $comment;
$_comment->king_news_comment_list_args = $args;
$comment = $_comment;
$tag = 'div' === $args['style'] ? 'div' : 'li';
?>
<<?php
echo $tag;
?>
<?php
comment_class($args['has_children'] ? 'parent' : '');
?>
id="comment-<?php
comment_ID();
?>
">
<article id="div-comment-<?php
comment_ID();
?>
" class="comment-body">
<div class="comment-body__holder">
<?php
get_template_part('template-parts/comment');
?>
</div>
</article><!-- .comment-body -->
<?php
}
示例10: sandbox_ping
function sandbox_ping($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
<li <?php
comment_class(sandbox_comment_class(false));
?>
id="comment-<?php
comment_ID();
?>
">
<div class="comment-metadata">
<?php
printf(__('By %1$s on %2$s at %3$s', 'sandbox'), get_comment_author_link(), get_comment_date(), get_comment_time());
?>
<?php
edit_comment_link(__('(Edit)', 'sandbox'), ' ', '');
?>
</div>
<div class="comment-mod"><?php
if ($comment->comment_approved == '0') {
_e('<em>Your trackback/pingback is awaiting moderation.</em>', 'sandbox');
}
?>
</div>
<?php
comment_text();
}
示例11: paragrams_comments
function paragrams_comments($comment, $args, $depth)
{
$default = urlencode(get_bloginfo('template_directory') . '/images/default-avatar.png');
$GLOBALS['comment'] = $comment;
?>
<li <?php
comment_class();
?>
id="li-comment-<?php
comment_ID();
?>
">
<div id="comment-<?php
comment_ID();
?>
">
<div class="comment-author vcard">
<?php
$myavatar = get_bloginfo('template_directory') . '/images/gravatar.png';
echo get_avatar($comment, $size = '55', $default);
?>
<?php
printf(__('<cite class="fn">%s</cite> <span class="says">wrote:</span>'), get_comment_author_link());
?>
</div>
<?php
if ($comment->comment_approved == '0') {
?>
<em><?php
_e('Your comment is awaiting moderation.');
?>
</em>
<br />
<?php
}
?>
<div class="comment-meta commentmetadata"><a href="<?php
echo htmlspecialchars(get_comment_link($comment->comment_ID));
?>
"><?php
printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time());
?>
</a><?php
edit_comment_link(__('(Edit)'), ' ', '');
?>
</div>
<?php
comment_text();
?>
<div class="reply">
<?php
comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</div>
</div>
<?php
}
示例12: show_comment
function show_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<li <?php
comment_class();
?>
>
<div class="avatar">
<?php
echo get_avatar($comment, 70, $default = 'mystery');
?>
</div>
<div class="author">
<?php
echo get_comment_author_link();
?>
</div>
<div class="comment-meta">
<?php
printf('%1$s — %2$s', get_comment_date(), get_comment_time());
?>
</div>
<?php
comment_text();
?>
<div class="reply">
<?php
comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</div>
</li>
<?php
}
示例13: my_custom_comments
function my_custom_comments($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<li <?php
comment_class();
?>
id="li-comment-<?php
comment_ID();
?>
">
<?php
if ($comment->comment_approved == '0') {
?>
<em><?php
_e('Your comment is awaiting moderation.');
?>
</em>
<?php
}
?>
<?php
echo '<div class="pull-left"><div class="commentor-avatar" style="height: 90px; width: 90px; background: url(' . get_avatar_url($comment) . ') no-repeat center center; background-size: cover;"><div class="commentor-name">' . get_comment_author() . '</div></div></div>';
comment_text();
echo '<div class="clearfix"></div>';
}
示例14: studiofolio_comment
<?php function studiofolio_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?>>
<article id="comment-<?php comment_ID(); ?>">
<header class="comment-author vcard">
<?php echo get_avatar($comment, $size = '32'); ?>
<?php printf(__('<cite class="fn">%s</cite>', 'studiofolio'), get_comment_author_link()); ?>
<time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>"><?php printf(__('%1$s', 'studiofolio'), get_comment_date(), get_comment_time()); ?></a></time>
<?php edit_comment_link(__('(Edit)', 'studiofolio'), '', ''); ?>
</header>
<?php if ($comment->comment_approved == '0') : ?>
<div class="alert alert-block fade in">
<a class="close" data-dismiss="alert">×</a>
<p><?php _e('Your comment is awaiting moderation.', 'studiofolio'); ?></p>
</div>
<?php endif; ?>
<section class="comment">
<?php comment_text() ?>
</section>
<?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
</article>
<?php } ?>
示例15: reverie_comments
function reverie_comments($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<li <?php
comment_class();
?>
>
<article id="comment-<?php
comment_ID();
?>
">
<header class="comment-author vcard">
<?php
echo get_avatar($comment, $size = '40');
?>
<?php
printf(__('<cite class="fn">%s</cite>', 'reverie'), get_comment_author_link());
?>
<time datetime="<?php
echo comment_date('c');
?>
"><a href="<?php
echo htmlspecialchars(get_comment_link($comment->comment_ID));
?>
"><?php
printf(__('%1$s', 'reverie'), get_comment_date(), get_comment_time());
?>
</a></time>
<?php
edit_comment_link(__('(Edit)', 'reverie'), '', '');
?>
</header>
<?php
if ($comment->comment_approved == '0') {
?>
<div class="notice">
<p class="bottom"><?php
_e('Your comment is awaiting moderation.', 'reverie');
?>
</p>
</div>
<?php
}
?>
<section class="comment">
<?php
comment_text();
?>
</section>
<?php
comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</article>
<?php
}