<?php 
    if (has_comments()) {
        ?>
			<ul class="commentlist">
				<?php 
        $i = 0;
        while (comments()) {
            $i++;
            ?>
				<li class="comment" id="comment-<?php 
            echo comment_id();
            ?>
">
					<div class="wrap">
						<h2><?php 
            echo comment_name();
            ?>
</h2>
						<time><?php 
            echo relative_time(comment_time());
            ?>
</time>

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

						<span class="counter"><?php 
            echo $i;
Example #2
0
            <header class="anchor-article__title mdl-card__title">
                <h2 class="mdl-card__title-text">
                    <?php 
        echo total_comments() . pluralise(total_comments(), ' Comment');
        ?>
                </h2>
            </header>

            <!-- Post content -->
            <section class="anchor-article__content mdl-card__supporting-text mdl-typography--text-justify">
                <?php 
        while (comments()) {
            ?>
                    <?php 
            // Insert default the name if not specified
            $name = comment_name();
            if (empty($name)) {
                $name = 'Anonymous';
            }
            ?>
                    <article id="comment<?php 
            echo comment_id();
            ?>
" class="anchor-comment">
                        <div class="anchor-comment__avatar mdl-color--<?php 
            echo color($name);
            ?>
">
                            <?php 
            echo strtoupper(substr($name, 0, 1));
            ?>