Skip to content

Instantly share code, notes, and snippets.

@kathrynwp
Last active February 9, 2024 18:39
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 kathrynwp/9b7ea205ee3c0d812ba5758178fd70f0 to your computer and use it in GitHub Desktop.
Save kathrynwp/9b7ea205ee3c0d812ba5758178fd70f0 to your computer and use it in GitHub Desktop.
Add author bio to Minnow
<?php // Start if statement for author bio
if ( is_author() ) : ?>
<div class="author-info">
<h2 class="author-heading"><?php _e( 'Published by', 'minnow' ); ?></h2>
<div class="author-avatar">
<?php
$author_bio_avatar_size = apply_filters( 'minnow_author_bio_avatar_size', 56 );
echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
?>
</div><!-- .author-avatar -->
<div class="author-description">
<h3 class="author-title"><?php echo get_the_author(); ?></h3>
<p class="author-bio">
<?php the_author_meta( 'description' ); ?>
<a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
<?php printf( __( 'View all posts by %s', 'minnow' ), get_the_author() ); ?>
</a>
</p><!-- .author-bio -->
</div><!-- .author-description -->
</div><!-- .author-info -->
<?php endif; ?>
@olp-cs
Copy link

olp-cs commented Oct 19, 2016

There is a missing part:

<?php endif; ?>

Without this ending statement, the code doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment