Want to display related posts by the same author in WordPress? Normally, you can use any related posts plugin to display similar articles on your website. However, if you run a multi-author WordPress website, users may want to read other content from the same author. In this article, we will show you how to display related posts by the same author in WordPress.
This method is easier and is recommended for all users.
The first thing you need to do is install and activate the Similar Posts plugin. For more details, check out our step-by-step guide on how to install a WordPress plugin.
Upon activation, you need to visit Settings »Similar Posts page to configure plugin settings.
The settings page is divided into different tabs, and you'll land on the General tab by default. You can review the options and change them to match your requirements.
On this page, you need to scroll down to the bottom and select 'Yes' next to the 'Match Current Post Author' option. You can uncheck other matching options to ensure the plugin only fetches posts by author.
Next, you need to switch to the "Location" tab and activate the "Output after publication" option. You can also edit the output template by editing the text in the 'Parameters' box.
Don't forget to click the 'Save Settings' button to save your changes.
You can now visit any single post on your website, and you'll see related posts by the same author after the post content.
This method requires you to add code to your WordPress theme files. If you haven't done so before, check out our guide on how to copy and paste code in WordPress.
You will need to add the following code to your theme's functions.php file or in a site-specific plugin.
función wpb_related_author_posts ($ content) if (is_single ()) global $ authordata, $ post; $ contenido. = 'Publicaciones similares por el autor:
'; $ author_posts = get_posts (array ('author' => $ authordata-> ID, 'post__not_in' => array ($ post-> ID), 'posts_per_page' => 5)); $ contenido. = '
You can now visit any single post on your website, and you'll see related posts by the same author below the content.
We hope this article helped you learn how to easily display related posts by the same author in WordPress. You may also want to see our definitive list of the most wanted WordPress tips, tricks, and hacks for beginners.
If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Facebook.