Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
WordPress - show an author bio using a custom photo, on an author page
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
<h1><?php echo $curauth->display_name; ?>'s blog</h1>
$publisher_photo = get_the_author_meta('your_photo');
$image_src = wp_get_attachment_image_src($publisher_photo);
if($image_src[0] != NULL) { ?>
<div class="row author">
<div class="two columns mobile-twelve">
<?php echo '<img class="author-picture" src="'. $image_src[0] .'" />'; ?>
<div class="ten columns mobile-twelve">
<p class="author-bio"><?php echo $curauth->description; ?></p>
<a href="<?php echo site_url(); ?>/about/" class="author-link">Read More</a>
<?php } ; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment