Linking gravatar using template path?
-
Hi,
I’m currently making a theme based on ‘sandbox’ I’ve been able to to change the default gravatar by linking to one that i’ve placed in the themes image folder…
I would prefer to use a dynamic link using the template path. Here’s what I’ve got so far
function nneon_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', '32' ); // Available filter: avatar_size $grav_url = "http://website.com/wp-content/themes/xoxo/images/gravatar.jpg"; $avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( $avatar_email, $avatar_size, $grav_url ) ); echo $avatar . ' <span class="fn n">' . $commenter . '</span>'; }what do i need to do in order to use:
<?php bloginfo('template_directory'); ?>/images/gravatar.jpg?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Linking gravatar using template path?’ is closed to new replies.