Skip to content

Instantly share code, notes, and snippets.

@ianthompson
Last active August 29, 2016 14:33
Show Gist options
  • Save ianthompson/db068863c85c34a576442750c6e1c33a to your computer and use it in GitHub Desktop.
Save ianthompson/db068863c85c34a576442750c6e1c33a to your computer and use it in GitHub Desktop.
Add Author bio to your Beaver Builder posts on Wordpress
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">
<h3 class="media-heading"><?php the_author(); ?></h3>
<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