Created
November 9, 2017 07:42
-
-
Save ahaywood/50d615c7ef1835f9d80957bbd9ce506c to your computer and use it in GitHub Desktop.
PHP - WP: Ah Ha Comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php wp_list_comments(array( | |
'avatar_size' => '140', | |
'type' => 'comment', | |
'callback' => 'ahha_comments' | |
)); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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