added support for author meta

This commit is contained in:
Adam Piontek 2022-12-26 11:49:00 -05:00
parent 4ff30a6433
commit 706c524755
7 changed files with 573 additions and 434 deletions

View file

@ -12,7 +12,27 @@ get_header(); ?>
<main class="container d-flex justify-content-center">
<div class="col-12 col-md-10 col-lg-9 col-xl-8 col-xxl-7 pb-2 mb-4 mt-3">
<?php if (is_archive()) : ?>
<?php if (is_author()) :
// If a user has filled out their description, show a bio on their entries.
if ( get_the_author_meta( 'description' ) ) { ?>
<div id="author-info" class="d-flex flex-row mb-4 tek-border-bottom-gray-dashed">
<div id="author-avatar" class="flex-shrink-0 me-3 pt-1">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), $size = '96', $default = '', $alt = '', $args = array( 'class' => 'rounded-3' )); ?>
</div><!-- #author-avatar -->
<div id="author-description" class="flex-grow-1 mb-2">
<h1 class="text-muted fst-italic mb-0"><?php printf( __( 'Author: %s', '' ), get_the_author() ); ?></h1>
<?php the_author_meta( 'description' ); ?>
</div><!-- #author-description -->
</div><!-- #entry-author-info -->
<?php } else {
// if user does not have description, show standard archive title
?>
<h1 class="text-muted fst-italic mb-4 tek-border-bottom-gray-dashed"><?= get_the_archive_title(); ?></h1>
<?php } ?>
<?php elseif (is_archive()) : ?>
<h1 class="text-muted fst-italic mb-4 tek-border-bottom-gray-dashed"><?= get_the_archive_title(); ?></h1>
<?php