Skip to content

Instantly share code, notes, and snippets.

@ahaywood
Created November 9, 2017 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahaywood/50d615c7ef1835f9d80957bbd9ce506c to your computer and use it in GitHub Desktop.
Save ahaywood/50d615c7ef1835f9d80957bbd9ce506c to your computer and use it in GitHub Desktop.
PHP - WP: Ah Ha Comments
<?php wp_list_comments(array(
'avatar_size' => '140',
'type' => 'comment',
'callback' => 'ahha_comments'
)); ?>
function ahha_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<div class="row" id="li-comment-<?php comment_ID(); ?>">
<div class="large-offset-1 columns large-2"><?php echo get_avatar($comment,'140'); ?></div>
<div class="large-8 columns end">
<?php if ($comment->comment_approved == '0') : ?>
<em><?php _e('Your comment is awaiting moderation.') ?></em><br />
<?php endif; ?>
<p><strong><em>On <?php echo get_comment_date('F d, Y') . ', '; echo get_comment_author_link(); ?> said:</em></strong><br />
<?php edit_comment_link(__('(Edit)<br />'),' ',''); ?>
<?= get_comment_text(); ?></p>
</div>
</div><!-- /.row -->
<hr class="space" />
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment