i actually implemented this on my last project. however i ended up copying and modding the entire comments.php. would be nice for default avatar to be a simple filter.
//define constant
define('THEME_URI', get_stylesheet_directory_uri());
/* ********************************************** */
/* Comments */
/* ********************************************** */
//Avatar size
function childtheme_avatarsize() {
return '68';
}
add_action( 'avatar_size', 'childtheme_avatarsize' );
// Custom callback to list comments in my style
function child_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
$GLOBALS['comment_depth'] = $depth;
?>
<li id="comment-<?php comment_ID() ?>" class="<?php thematic_comment_class() ?>">
<div class="comment-wrap clearfix">
<div class="comment-author vcard"><?php child_commenter_link() ?></div>
<?php child_commentmeta(); ?>
<?php if ($comment->comment_approved == '0') _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'thematic') ?>
<div class="comment-content">
<span class="speech-bubble"></span>
<?php comment_text() ?>
<?php // echo the comment reply link with help from Justin Tadlock http://justintadlock.com/ and Will Norris http://willnorris.com/
if($args['type'] == 'all' || get_comment_type() == 'comment') :
comment_reply_link(array_merge($args, array(
'reply_text' => __('Reply','thematic'),
'login_text' => __('Log in to reply.','thematic'),
'depth' => $depth,
'before' => '<div class="comment-reply-link">',
'after' => '</div>'
)));
endif;
?>
</div><!-- .comment-content -->
</div><!-- .comment-wrap clearfix-->
<?php }
// Produces an avatar image with the hCard-compliant photo class, and using my custom default
function child_commenter_link() {
$commenter = get_comment_author_link();
if ( ereg( '<a[^>]* class=[^>]+>', $commenter ) ) {
$commenter = ereg_replace( '(<a[^>]* class=[\'"]?)', '\\1url ' , $commenter );
} else {
$commenter = ereg_replace( '(<a )/', '\\1class="url "' , $commenter );
}
$avatar_email = get_comment_author_email();
$avatar_size = apply_filters( 'avatar_size', '80' ); // Available filter: avatar_size
$avatar = get_avatar( $avatar_email, $avatar_size, THEME_URI . '/images/default_avatar.png' );
$avatar = str_replace( "class='avatar", "class='photo avatar", $avatar );
echo ' <span class="fn n">' . $commenter . '</span>' . $avatar ;
} // end thematic_commenter_link
function child_commentmeta() {
$content = '<div class="comment-meta">' .
sprintf( __('%1$s <br /> %2$s <br /> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'thematic' ),
get_comment_date('M d, Y'),
get_comment_time(),
'#comment-' . get_comment_ID() ) .
'</div>' . "\n";
echo $content;
}
// end thematic_commentmeta
function my_callback() {
$content = 'type=comment&callback=child_comments';
return $content;
}
add_filter('list_comments_arg', 'my_callback');