Content Marketing

WordPress: Add Author Information in Sidebar

UPDATE: I’ve developed a Sidebar Widget to display your Author Information.

Today’s post by Jon Arnold was fantastic on tips for designing a website, but I noticed the first comment attributed the post to me. That’s a telltale sign I need to make the author information more prominent.

I’ve not created a widget for this (and I’m surprised that no one else has!), but I was able to edit my sidebar in my WordPress blog theme and add the following code:

<?php if(is_single()) { ?>
<li class="the_author"><h3 class="widgettitle">About the Author</h3>
<?php echo get_avatar(get_the_author_meta('user_email'), $size = '96'); ?>
<h4><a href="><?php the_author_meta('user_url'); ?>">
<?php the_author_meta('display_name'); ?></a></h4><p>
<?php the_author_meta('description'); ?></p></li><?php } ?>

On a single post page, an additional sidebar section is added that has a photo of the author (using a gravatar), their full name, their home page and their bio information as described in their user profile. I added a couple classes to handle ensuring the gravatar floated to the left and the height of the section had a minimum height in the event an author had no information.

get_the_author_meta(’email’) retrieves the email address of the author and passes it to the get_avatar function. The get_avatar function translates the email into an identifier that’s passed to the gravatar server to post the appropriate image. This is essential since you want to avoid making an email address available in the source of the page… spammers love to harvest emails.

The other data is retrieved simply using the_author_meta information.

Appreciate this content?

Sign up for our weekly newsletter, which delivers our latest posts every Monday morning.

We don’t spam! Read our privacy policy for more info.

Douglas Karr

Douglas Karr is a fractional Chief Marketing Officer specializing in SaaS and AI companies, where he helps scale marketing operations, drive demand generation, and implement AI-powered strategies. He is the founder and publisher of Martech Zone, a leading publication in marketing technology, and a trusted advisor to startups and enterprises alike. With a track record spanning more than $5 billion in MarTech acquisitions and investments, Douglas has led go-to-market strategy, brand positioning, and digital transformation initiatives for companies ranging from early-stage startups to global tech leaders like Dell, GoDaddy, Salesforce, Oracle, and Adobe. A published author of Corporate Blogging for Dummies and contributor to The Better Business Book, Douglas is also a recognized speaker, curriculum developer, and Forbes contributor. A U.S. Navy veteran, he combines strategic leadership with hands-on execution to help organizations achieve measurable growth.

Related Articles

Back to top button
Close

Adblock Detected

We rely on ads and sponsorships to keep Martech Zone free. Please consider disabling your ad blocker—or support us with an affordable, ad-free annual membership ($10 US):

Sign Up For An Annual Membership