Serving as the trust worthiest companion of blog owners, WordPress CMS has gathered numerous appreciations from different corners of the world. Loaded with multiple customization options, WordPress allows you to have your kind of blog as per your convenience. Displaying recent posts belonging to a particular author is a tweak that can boost the visitors’ count for your WordPress blog. This is a post where I’ll be discussing all the steps that need to be followed for displaying the most recent posts by an author on your WordPress blogging website.
In this tutorial, I’ll be familiarizing you with different methods of displaying the most recent posts by a specific author. So, let’s get on to learn about these methods one by one:
Method No.1: Using a certain shortcode
While displaying the recent posts by an author on the sidebar is fairly simple, what if you’re inclined on displaying them within a particular WordPress page or post? Well, the simplest way to do this is using the shortcodes. Follow the below steps to display recent posts using shortcodes:
Install and activate a WordPress plugin named Display Posts Shortcode. You won’t be required to configure this plugin, as it doesn’t include any settings by default.
Now, edit the post or page where you intend to display the most recent posts by a registered author
Finally, use the shortcode [display-posts] along with parameters within the post. The Display Posts Shortcode plugin is packaged with parameters that can be used along with this shortcode. Some of the popularly used parameters include the ones mentioned below:
- For displaying 4 recent posts with thumbnails and excerpts
[display-posts posts_per_page="4" image_size="thumbnail" include_excerpt="true"]
- For displaying recent pages under a specific parent page
[display-posts posts_per_page="6" post_type="page" post_parent="6"]
- For displaying recent pages instead of posts
[display-posts posts_per_page="6" post_type="page"]
Method No.2: Using WordPress Recent Posts Widget
By default, WordPress comes with a widget that can be utilized for displaying the recent posts by an author within the site’s sidebar or a chosen widget-ready area. To get started with using this WordPress default widget, all you need to do is go to your admin dashboard-> Appearance-> Widgets and choose to add the Recent Posts widget to your sidebar. Have a look at the below screen-shot which displays this method:
As is visible in the above screen-shot, you can provide a suitable title to your custom widget, choose a suitable display date for the posts and also set a count for the posts that you want to display on your WP blog. Once you’re done with entering your preferences, just click on ‘Save’ button to save the settings for this widget.
Method No.3: Using the manual approach for adding the recent posts (the ones which you want to display) directly into the WordPress theme files
If you were an advanced WordPress user, then you’d definitely be interested in adding the most recent posts into your WordPress theme files. Well, there are several ways of doing the same, but the simplest one is to use the built-in WP_Query class. Here, you just need to add the below code to the area where you want to display the most recent posts:
<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>
Well, the above code displays the five most recent posts(along with their titles and excerpts). Here, the WP_Query class comprises of multiple parameters that aid you in customizing the display of recent posts in your own unique way.
Method No.4: Using the Recent Posts Widget Extended plugin
As already discussed under method no.2, WordPress’ in-built widget isn’t competent in allowing you to display the thumbnails or excerpts along with recent posts. Well, the Recent Posts Widget Extended plugins comes handy here. Upon installation and activation of this plugin for your WordPress website/blog, just head on to your admin dashboard-> Appearance-> Widgets and simply add the Recent Posts Extended Widget to the sidebar. Have a look at the below screen-shot:
The Recent Posts Extended plugin comes with multiple options for rendering you complete control on how the recent posts should be displayed on the WordPress website. For instance, you can show excerpts, thumbnails, ignore the sticky posts, limit tags and categories etc.
In your journey of exploring the hidden potential of WordPress, you’d definitely want to display recent posts (written by a specific author) in WordPress posts and pages. Here’s hoping the above post would serve as your handy guide in case such a requirement crops in at your end.