How To Display Related Posts By Same Author In WordPress
How To Display Related Posts By Same Author In WordPress

There are often times when users want to read various articles from the same author. So as to do that, users usually subscribe to their preferred authors. But one inconvenience that is faced by every such user is that every time they finish reading one article, they have to return to the main page to select and start reading a new one. 

In order to remove this hindrance and make your reading more convenient and smooth, WordPress provides you with a very interesting feature that shows you the related posts by the same author. Normally, any related posts plugin can be used to show similar articles. However, if you are one of those who runs a multi-author WordPress, then you may want to read other content from the same author. In this article, you can find a guide to how you can display related posts by the same author in WordPress.

You can also watch the video tutorial:

METHOD 1: Display Related Posts by Author in WordPress Using Plugin

This method, being comparatively easier, is suggested for all users. 

  • The first step you are required to do is to install and activate the Similar Posts plugin.
  • Once you are done with the activation, you would have to visit the Settings menu.
How To Display Related Posts By Same Author In WordPress
  • In Settings, search for the Similar Posts page and configure plugin settings.
  • The site makes you land on the General Tab by default. You can go through different options and change them according to your requirements.
How To Display Related Posts By Same Author In WordPress
  • Next, scroll down to the bottom and select ‘Yes’ next to the option saying ‘Match the current post’s author’. 
How To Display Related Posts By Same Author In WordPress
  • Next step is to switch to the ‘Placement Tab’ and activate the ‘Output after post’ option. Output template can also be edited by editing the text in the ‘Parameters’ box.
How To Display Related Posts By Same Author In WordPress
  • Once you are done with all these steps, make sure you save your changes by clicking on the ‘Save Settings’ button.

By following these steps, you will be able to visit any single post on your site, and all the related posts from the same author will be visible to you.

METHOD 2: Manually Display Related Posts by Same Author in WordPress

  • The user is required to add code to your WordPress theme files in this method.
  • The below mentioned code needs to be added to your theme’s functions.php file-

Code:

function wpb_related_author_posts($content) {
 
if ( is_single() ) {
    global $authordata, $post;
     
    $content .= '<h4>Similar Posts by The Author:</h4> ';
  
    $authors_posts = get_posts( array( 'author' => $authordata->ID, 'post__not_in' => array( $post->ID ), 'posts_per_page' => 5 ) );
  
    $content .= '<ul>';
    foreach ( $authors_posts as $authors_post ) {
        $content .= '<li><a href="' . get_permalink( $authors_post->ID ) . '">' . apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '</a></li>';
    }
    $content .= '</ul>';
  
    return $content;
    }
    else {
    return $content;
    }
}
 
add_filter('the_content','wpb_related_author_posts');

By installing this code, you would be able to visit  any single post on your website, and you’ll see related posts by the same author as well.

We hope that through this guide of ours, you will now be able to easily display related posts by the same author in WordPress. In case you find yourself stuck at any step, feel free to check out our website or you might as well contact us directly. 

Read More: Why is social media presence an essential thing for your brand?

0 Comments

Submit a Comment

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

Need Professional Help?

We can help you with website fixes and ongoing maintenance.