Skip to content

Instantly share code, notes, and snippets.

@simonlk
Created June 8, 2016 01:33
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 simonlk/4d46e21a1710e9c8abc5a1faad2745de to your computer and use it in GitHub Desktop.
Save simonlk/4d46e21a1710e9c8abc5a1faad2745de to your computer and use it in GitHub Desktop.
// Author profile box
// Thanks Justin Busa and Viktor http://forum.wpbeaverbuilder.com/support/q/author-bio-box/
function my_author_bio($content) {
if ( is_singular('post') ) {
ob_start(); ?>
<div class="fl-author-bio clearfix media well">
<div class="fl-author-bio-thumb media-left">
<img src="<?php echo get_avatar_url( get_the_author_meta('ID'), 96 ); ?>" alt="<?php the_author(); ?>" class="media-object" />
</div>
<div class="fl-author-bio-text media-body">
<p class="media-heading"><?php the_author_posts_link(); ?></p>
<p><?php echo get_the_author_meta( 'user_description' ); ?></p>
</div>
</div>
<?php
$authorbox = ob_get_contents();
ob_end_clean();
return $content.$authorbox; }
else {
return $content;
}
}
add_filter( 'the_content', 'my_author_bio' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment