Created
October 30, 2011 00:21
-
-
Save billerickson/1325292 to your computer and use it in GitHub Desktop.
Avatar on Teasers
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 | |
/** | |
* Avatar on Teasers | |
* | |
* @link http://www.billerickson.net/using-gravatars-in-wordpress/ | |
* @author Bill Erickson | |
* | |
*/ | |
function custom_author_post_avatar_teaser(){ | |
if( is_home() ){ | |
if( get_query_var( 'author_name' ) ){ | |
$curauth = get_userdatabylogin( get_query_var( 'author_name' ) ); | |
}else{ | |
$curauth = get_userdata( get_query_var( 'author' ) ); | |
} | |
?> | |
<div style="float:left;padding-right:10px;padding-bottom:10px;"> | |
<? echo "<a href=\"".get_bloginfo('url')."/author/".get_the_author_meta( 'user_login' )."\">".get_avatar( get_the_author_email(), '50' )."</a>"; ?> | |
</div> | |
<? | |
} | |
} | |
add_action('thesis_hook_before_teaser', 'custom_author_post_avatar_teaser'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment