Customizing Divi Author Pages

Written by Dan Mossop

The Divi Theme doesn't currently offer much in the way of options for customizing the author post listings pages (the pages that show all the posts by a single author). This post gives some options for styling the author post pages, which will hopefully give you a starting point for customizing these pages.

Creating an author.php Page

When a user visits an author page on your site, they are presented with a list of posts of that author. But where does the layout of that page come from? When the author page is visited Divi looks for a template file to use to display the page. It considers several options, including a file called "author.php" which specifies a template to use for all author pages. If the theme doesn't include this file (which Divi doesn't), WordPress looks for fallback templates. In the case of Divi it ends up using the main Divi index.php file, located in the root of the Divi theme folder.

If we want to edit the authors pages, one option is to make a copy of this index.php file and call it author.php. Putting this in the main Divi directory (the same one as has the index.php file) will cause WordPress to use the author.php copy instead of the index.php file.

We could leave the new author.php file where it is, but unfortunately it would get overwritten next time you update Divi. It is much better to create a child theme and put the author.php file in the main folder of this child theme. Now your changes will survive any Divi updates.

I'm not going to go into a lot of detail of all the things that could be done with this file. But I will give a simple example to give you a taste of what's possible.

In the author.php file you'll see the start of the code looks something like this:

<?php get_header(); ?>

<div id="main-content">
	<div class="container">
		<div id="content-area" class="clearfix">
			<div id="left-area">
		<?php
			if ( have_posts() ) :
Now we'll change this to add a simple author bio box with the following code:
<?php get_header(); ?>

<div id="main-content">
	<div class="container">
		<div id="content-area" class="clearfix">
			<div id="left-area">
				<style>
					#author-info { background-color: #eee; border: 1px solid #ddd; padding: 20px; }
					#author-img { float: left; margin-right: 20px; }
				</style>
				<div id="author-info">
					<div id="author-img"><?php echo get_avatar(get_the_author_meta('email'), 90); ?></div>
					<h2 id="author-name"><?php esc_html_e(get_the_author_meta('display_name'));?></h2>
					<p id="author-desc"><?php esc_html_e(get_the_author_meta('user_description')); ?></p>
					<p id="author-url"><a href="<?php esc_attr_e(get_the_author_meta('user_url')); ?>">Website</a></p>
				</div>
		<?php
			if ( have_posts() ) :
Save the author.php file.

Note that on earlier versions of Wordpress (pre-4.9), you may need to replace "user_description" in the above code with just "description".

Now, with the child theme active, view the author page. You should see something like this author bio box at the top of your author page:

Using the Taxonomy Layout Injector plugin

The Taxonomy Layout Injector plugin allows you to use the Divi Builder to edit archive pages such as the author archive pages.

It lets you assign a Divi Builder layout to use on the author pages. The plugin includes custom modules to display the author's photo and name. I don't currently see any mention in the plugin's docs of a way to display the author bio, but one way to do it would be to add a code module in that layout and within the code module put a shortcode that displays the author description.

The free Author Bio Shortcode plugin adds just such a shortcode. It hasn't been updated in a while, but given that it's dealing with quite basic WordPress functionality it's likely that it still works. There are probably others that do something similar, but that's the first one I saw.

Want get more out of Divi?

Hundreds of new features for Divi
in one easy-to-use plugin

7 Comments

  1. Thank you! It worked!

    Reply
    • You're welcome, Vijay!

      Reply
  2. Thanks for the code. I made some changes to the author bio code you provided and implemented it on my site.

    Reply
  3. Hi Dan, I've followed your great tutorial but now after the recent wordpress update (4.9) I see tags wrapping the author description on front end.
    Do you know why this is happening?
    Thanks in advance for your answer!

    Reply
    • I resolved Dan! I changed 'description' with 'user_description' in the php code ;)

      Reply
      • Nice one, Pascal! I could see the tags in 4.9 as well, and your fix works for me too :) I've updated the post accordingly. Thanks!

        Reply
  4. Cool! I will try it! Thanks!

    Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

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

Unlock New Possibilities with Divi Booster

Elevate your Divi experience by effortlessly customizing pages like author listings with Divi Booster. With hundreds of new features, you can enhance every aspect of your site, including templates used for author pages.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

7 Comments

  1. Thank you! It worked!

    Reply
    • You're welcome, Vijay!

      Reply
  2. Thanks for the code. I made some changes to the author bio code you provided and implemented it on my site.

    Reply
  3. Hi Dan, I've followed your great tutorial but now after the recent wordpress update (4.9) I see tags wrapping the author description on front end.
    Do you know why this is happening?
    Thanks in advance for your answer!

    Reply
    • I resolved Dan! I changed 'description' with 'user_description' in the php code ;)

      Reply
      • Nice one, Pascal! I could see the tags in 4.9 as well, and your fix works for me too :) I've updated the post accordingly. Thanks!

        Reply
  4. Cool! I will try it! Thanks!

    Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

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

We may earn a commission when you visit links on our website.