Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress - show an author bio using a custom photo, on an author page
<?php
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
?>
<h1><?php echo $curauth->display_name; ?>'s blog</h1>
<?php
$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>
<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>
</div>
</div>
<?php } ; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment