How to display posts belonging to a specific author on wordpress

WordPress is packaged with features and functionalities that can easily create a ‘wow’ factor for your website/blog. You can utilize multiple techniques of growing the visitors’ count for your WordPress enriched website/blog. One of the most remarkable features belonging to WordPress is the flexibility of displaying the posts written by a particular author. By making the most of this WordPress feature, it will become quite convenient for you to boost the count of visitors for your WordPress blog. In today’s post, I’ll be enlightening you about four of the most remarkable methods of displaying the most recent posts written by one of the esteemed authors of the WordPress blogging website. So, let’s take a closer look at these techniques that will allow you(the webmaster) to display related posts by an author.

Method No.1 – The manual technique of adding the recent posts by an author directly into the core WordPress theme files.

It is WordPress’ built-in WP_Query class that allows you to add the most recent blog posts by an author into the WordPress theme files. As per the manual approach, all you need  is to simply add the below-mentioned code into the area where you intend to display the latest posts by the author under focus:

// Define our WP Query Parameters
have_posts()) : $the_query -> the_post(); ?>
<ul>
// Define our WP Query Parameters

<?php $the_query = new WP_Query( 'posts_per_page=6' ); ?>

// Start our WP Query

<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>

// Display the Post Title with Hyperlink

<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>

// Display the Post Excerpt

<li><?php the_excerpt(__('(more…)')); ?></li>

// Repeat the process and reset once it hits the limit

<?php

endwhile;

wp_reset_postdata();

?>

</ul>

It is important to note that the above code will display five most recent posts, their titles and excerpts. You can find the WP_Query class which includes multiple parameters which would allow you to moderate the display of the recent posts in the preferred format.

Method No.2- Using a suitable shortcode

If you’re interested in displaying the most recent posts by an author within a certain WordPress post or page, one of the best techniques to follow is the use of shortcodes. Have a look at the below steps that allow you to display the recent posts by an author using the shortcodes:

Step 1- Download, install and activate the popular WordPress plugin called Display Posts Shortcode. The best thing about this plugin is that it doesn’t include any settings and hence you need not configure it.

Step 2- Next, get on with editing the WordPress post or page where you want the recent posts by an author to be displayed

Step 3- Now, add the shortcode i.e. [display-posts] along with parameters into the post which you’ve chosen to edit as per the step no.2 above. You can find some built-in parameters in the Display Posts Shortcode plugin. These parameters can be easily used with the shortcode. Have a look at some of the parameters that I’m referring to:

1. [display-posts posts_per_page=”8″ post_type=”page” post_parent=”7″]

This parameter is used for displaying 7 most recent pages under a particular parent page.

2. [display-posts posts_per_page=”4″ image_size=”thumbnail” include_excerpt=”true”]

This is the parameter that allows you to display 4 recent posts along with their thumbnails and excerpts.

[display-posts posts_per_page=”4″ post_type=”page”]

This parameter is used for displaying 4 recent pages instead of the recent posts.

Method No.3 – Utilizing WordPress Recent Posts Widget

WordPress’ Recent Posts Widget is a default widget that can be effectively used for displaying the most recent posts by an author. These posts are showcased on the sidebar or a certain widget-ready area. For using this WordPress default widget, just go to your WP admin dashboard and click on Appearance-> Widgets, followed by selecting the addition of Recent Posts widget to the website’s sidebar. Here’s a screenshot for the right use of the WordPress Recent Posts widget:

On the above screen, you’ll be required to provide a suitable title to the custom widget in addition to choosing a date when you want the posts to be displayed and also a count for the posts that you intend to display within the blog or page. After having entered your preferences, clicking on the ‘Save’ button will save all the settings for the WordPress Recent Posts widget.
That’s it for this post!

Wrapping Up
Rendering your visitors an ultimate flexibility of browsing through posts written by a particular author, you can turn successful in retaining their attention on your WordPress blog. Hope my post would have encouraged you to make the most of this WordPress feature efficiently.

POST REPLY

Pin It on Pinterest

Shares
Share This