Skip to content

Instantly share code, notes, and snippets.

@ernilambar
Created February 1, 2015 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ernilambar/42db423fb6eea9b2bbc6 to your computer and use it in GitHub Desktop.
Save ernilambar/42db423fb6eea9b2bbc6 to your computer and use it in GitHub Desktop.
author-box-snippet.php
<?php
add_action( 'blue_planet_author_box', 'custom_blue_planet_author_box' );
function custom_blue_planet_author_box(){
ob_start();
?>
<style>
.authorbox{
background-color:#F0F0F0;
border:1px #EEEEEE solid;
clear: both;
height: auto;
overflow: hidden;
padding: 10px;
margin:10px 0;
}
.authorbox .left{
float: left;
width: 90px;
height: 90px;
}
.authorbox .right{
float: right;
height: 100%;
overflow: hidden;
width: 100%;
max-width: 600px;
}
</style>
<div class="authorbox">
<div class="left">
<?php echo get_avatar( get_the_author_meta('user_email'), '80', '' ); ?>
</div>
<div class="right">
<p><strong>Written by <?php the_author_posts_link(); ?></strong></p>
<p><?php the_author_meta('description'); ?></p>
<?php $user_url = get_the_author_meta( 'user_url' ); ?>
<?php if ( ! empty( $user_url ) ): ?>
<p><a href="<?php echo esc_url( $user_url ); ?>" target="_blank">Website</a></p>
<?php endif ?>
</div>
</div>
<?php
$output = ob_get_contents();
ob_end_clean();
echo $output;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment