Forum Moderators: rogerd & travelin cat
/***********************************************************
******************* Custom Author Page *********************
***********************************************************/
function author_info() {
if (is_author() || get_the_author_meta($type, $id)) {
$value = get_query_var('author_name');
$author = get_userdatabylogin($value);
$authorID = $author->ID;
$custom_avatar = get_the_author_meta('imageurl', $authorID);
if ($authorID=="1")
echo ' ';
elseif ($avatar)
$return = $avatar;
else
echo '<div class="author_profile author_'. $authorID .'">
<div class="author_avatar"><img alt="Author" src="'. $custom_avatar .'" width="140" height="140" /></div>
<div class="author_info">
<div class="author_description">
<p>'. get_the_author_meta('description', $authorID) .'</p>
<p><strong>Author\'s Website:</strong><a href="'. get_the_author_meta('user_url', $authorID) .'">'. get_the_author_meta('wesitename', $authorID) .'</a></p>
</div>
</div>
<div class="author_links">
<a href="https://plus.google.com/'. get_the_author_meta('google_plus', $authorID) .'" rel="me" target="_blank"><img alt="Google Plus Profile" src="'. get_the_author_meta('google_plus_icon', $authorID) .'" width="128" height="64" /></a>
<a href="http://www.facebook.com/'. get_the_author_meta('facebook', $authorID) .'" target="_blank"><img alt="Facebook Page" src="'. get_the_author_meta('facebook_icon', $authorID) .'" width="128" height="64" /></a>
<a href="http://twitter.com/'. get_the_author_meta('twitter', $authorID) .'" target="_blank"><img alt="Twitter Page" src="'. get_the_author_meta('twitter_icon', $authorID) .'" width="128" height="64" /></a>
<a href="http://www.linkedin.com/company/'. get_the_author_meta('linkedin', $authorID) .'" target="_blank"><img alt="LinkedIn Profile" src="'. get_the_author_meta('linkedin_icon', $authorID) .'" width="128" height="64" /></a>
</div>
</div>
';
?>
<?php }
}
add_action('thesis_hook_before_content', 'author_info');
get_the_author_meta($type, $id) {
**Code to get value **
if(isset($value)) {
return $value;
} else {
return "#"; // Or some other string
}
}
if(isset(get_the_author_meta('google_plus', $authorID)) && isset(get_the_author_meta('google_plus_icon', $authorID))) :
<a href="https://plus.google.com/'. get_the_author_meta('google_plus', $authorID) .'" rel="me" target="_blank"><img alt="Google Plus Profile" src="'. get_the_author_meta('google_plus_icon', $authorID) .'" width="128" height="64" /></a>
endif;