Back to top

Affiliate Link: Looking to Monetize With Ads?? We Personally Use:

Ezoic

Building A Custom Author Profile After The Post Content

Featured Tiles
As an Amazon Associate we earn from qualifying purchases made on our website. If you make a purchase through links from this website, we may get a small share of the sale from Amazon and other similar affiliate programs. You can read our complete legal information for more details.

While I am ok with the default Acabado author box after your post there are some things which could be tweaked which will give it some more value and also provide you a way to expose your author’s social media links and possibly more details that are currently missing in standard Acabado.

I love the author box after the post, it can give the reader a chance to find more posts written by an author they found to be interesting if they have read to the end of the post. This additional click could give you a much better time-on-page reading by clicking to read your full bio or other links you choose to add.

Current Acabado Author Box

The current author box is very basic, it includes an image, the user name and the description only. I felt this was very limiting and so I started in rebuilding it.

Rebuilt Acabado Author Box

I was tired of the bland look to the end post author block so instead I rebuilt it into the below, it takes your image and name, your description, and then provides a button for posts by the author (useful for multi-author sites) and then the website listed for that user profile.

Acabado Author Box Version 1
Author Box Version 1

Author Content Pulled From User Details

Since I am working to use data from the user profile this means that I should be able to grow and add things if people are wanting more information in the profile.

Installed With Code Snippets

This is built using the Code Snippets plugin which you can download on WordPress from Add Plugins. Then you create a new snippet and paste in the following code. Set to run snippet everywhere, save and activate.

function acabado_author_info_box( $content ) {
	global $post;
 
	// Detect if it is a single post with a post author
	if ( is_single() && isset( $post->post_author ) ) {
 
	// Get author's display name 
	$display_name = get_the_author_meta( 'display_name', $post->post_author );
 
	// If display name is not available then use nickname as display name
	if ( empty( $display_name ) )
	$display_name = get_the_author_meta( 'nickname', $post->post_author );
 
	// Get author's biographical information or description
	$user_description = get_the_author_meta( 'user_description', $post->post_author );
 
	// Get author's website URL 
	$user_website = get_the_author_meta('url', $post->post_author);
 
	// Get link to the author archive page
	$user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));
  
	if ( ! empty( $display_name ) )
 
		$author_details = '<p class="author_name">About ' . $display_name . '</p>';
 
	if ( ! empty( $user_description ) )
		// Author avatar and bio
 		$author_details .= '<p class="author_details">' . get_avatar( get_the_author_meta('ID') , 90 ) . nl2br( $user_description ). '</p>';
		$author_details .= '<p><a class="author_links" href="'. $user_posts .'">My Posts</a>';  
 
		// Check if author has a website in their profile
	if ( ! empty( $user_website ) ) {
 
		// Display author website link
		$author_details .= ' | <a class="author_links" href="' . $user_website .'" target="_blank" rel="nofollow">Website</a></p>';
 
		} else { 
			// if there is no author website then just close the paragraph
			$author_details .= '</p>';
		}
 
		// Pass all this info to post content  
		$content = $content . '<footer class="author_bio_section" >' . $author_details . '</footer>';
		}
	return $content;
	}
 
// Add our function to the post content filter 
add_action( 'the_content', 'acabado_author_info_box' );
 
// Allow HTML in author bio section 
remove_filter('pre_user_description', 'wp_filter_kses');

add_action( 'wp_head', function () { ?>
	<style>
	.author_bio_section {
		background: none repeat scroll 0 0 #F5F5F5;
		padding: 15px;
	`	border: 1px solid #ccc;
		border-radius:6px;
	}
 
	.author_name{
		font-size:16px;
		font-weight: bold;
	}
 
	.author_details img {
		border: 1px solid #D8D8D8;
		border-radius: 50%;
		float: left;
		margin: 0 10px 10px 0;
	}
	.author_links {
		border: 1px solid transparent;
    	border-radius: 3px;
    	background: #363940;
    	color: #fff !important;
    	font-family: "Roboto Condensed", "Arial Narrow", Arial, Helvetica, sans-serif;
    	line-height: 1;
    	padding: 8px 18px;
    	text-transform: uppercase;
    	text-decoration: none;
    	transition: all .2s;
    	font-weight: bold;
    	letter-spacing: 1px;
    	font-size: small;
    	font-style: normal;
	}
	.author-card {
		display:none;
	}
	</style>
<?php } );

Final Thoughts

I hope people see this and it gives them a new and simple way to implement a new author box, worst case it gives you an idea of the amount of customization that is possible within the framework of Acabado while still maintaining a quality site speed.

If you find a post helpful and feel like rewarding my effort with the price of a beer, please donate here

About Josh Koop

Hey Everyone! I hope that the short article you read today has taken you from a place of frustration to a place of excited anticipation for your visitors! Please let me know of anything you need for Acabado that can help you achieve your goals!

My Posts | Website

Josh Koop

Hey Everyone! I hope that the short article you read today has taken you from a place of frustration to a place of excited anticipation for your visitors! Please let me know of anything you need for Acabado that can help you achieve your goals!

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Content