Family Encyclopedia >> Electronics

How to display related posts by the same author in WordPress

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.

How to display related posts by the same author in WordPress

Method 1:View Related Posts by Author in WordPress Using the Plugin

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.

How to display related posts by the same author in WordPress

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.

How to display related posts by the same author in WordPress

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.

How to display related posts by the same author in WordPress

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.

How to display related posts by the same author in WordPress

Method 2:Manually display related posts by the same author in WordPress

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. = '
    '; foreach ($ autores_posiciones como $ autores_post) $ contenido. = '
  • CARNÉ DE IDENTIDAD ) . '">'. apply_filters ('the_title', $ authors_post-> post_title, $ authors_post-> ID) '
  • '; $ contenido. = '
'; devolver $ contenido; else return $ content; add_filter ('the_content', 'wpb_related_author_posts');

You can now visit any single post on your website, and you'll see related posts by the same author below the content.

How to display related posts by the same author in WordPress

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.