예제 #1
0
<article
    id="post-<?php 
the_ID();
?>
"
    <?php 
post_class('clearfix blog-style');
?>
>


    <div class="entry-content">
        <div class="avatar">
            <?php 
echo swift_get_avatar(get_the_author_meta('ID'), apply_filters('swift_status_avatar', '72'));
?>
        </div>
        <?php 
the_content(sprintf(__('Continue reading %s&rarr;%s', 'swift'), '<span class="meta-nav">', '</span>'));
?>
    </div>
    <!-- .entry-content -->

    <footer class="entry-meta">
        <?php 
swift_posted_on();
?>
        <?php 
if (comments_open()) {
    ?>
예제 #2
0
/**
 *
 * Callback function for wp_list_comments, used in comments.php
 * Copied the original start_el fucntion from wp-includes/comments-template.php and
 * Changed the order of comments meta and added a class to the div containing avatar.
 * @param unknown_type $comment
 * @param unknown_type $args
 * @param unknown_type $depth
 */
function swift_comment($comment, $args, $depth)
{
    $depth++;
    global $post;
    $GLOBALS['comment_depth'] = $depth;
    $GLOBALS['comment'] = $comment;
    extract($args, EXTR_SKIP);
    if ('div' == $args['style']) {
        $tag = 'div';
        $add_below = 'comment';
    } else {
        $tag = 'li';
        $add_below = 'div-comment';
    }
    if ($comment->user_id > 0 && ($user = get_userdata($comment->user_id))) {
        // For comment authors who are the author of the post
        if ($post = get_post($post->ID)) {
            if ($comment->user_id === $post->post_author) {
                $avatar_class = 'bypostauthor';
            }
            $avatar_container_class = 'postauthor-avatar';
        }
    } else {
        $avatar_container_class = '';
    }
    ?>
    <<?php 
    echo $tag;
    ?>
 <?php 
    comment_class(empty($args['has_children']) ? '' : 'parent');
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
    <?php 
    if ('div' != $args['style']) {
        ?>
    <div id="div-comment-<?php 
        comment_ID();
        ?>
" class="comment-body">
<?php 
    }
    ?>
    <div class="comment-author vcard <?php 
    echo $avatar_container_class;
    ?>
">
        <?php 
    if ($args['avatar_size'] != 0) {
        echo swift_get_avatar($comment, $args['avatar_size']);
    }
    ?>
        <?php 
    printf(__('<cite class="fn">%s </cite> <span class="says">says:</span>'), get_comment_author_link());
    ?>

        <div class="comment-meta commentmetadata">
            <a
                href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
">
                <?php 
    /* translators: 1: date, 2: time */
    printf(__('%1$s at %2$s', 'swift'), get_comment_date(), get_comment_time());
    ?>
            </a>
            <?php 
    edit_comment_link(__('(Edit)', 'swift'), '&nbsp;&nbsp;', '');
    ?>
        </div>

    </div>
    <?php 
    if ($comment->comment_approved == '0') {
        ?>
    <em class="comment-awaiting-moderation"><?php 
        _e('Your comment is awaiting moderation.', 'swift');
        ?>
    </em> <br/>
<?php 
    }
    ?>


    <div class="comment-content">
        <?php 
    comment_text();
    ?>
    </div>

    <div class="reply">
        <?php 
    comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
    </div>
    <div class="clear"></div>
    <?php 
    if ('div' != $args['style']) {
        ?>
    </div>
<?php 
    }
}