As a WordPress site owner, one of your main goals is to provide as much valuable content to your visitors as possible.
One way to do that is by displaying a list of your latest posts within a Wordpress post or page. That way, if a visitor enjoys what they read, they can easily find and click on additional content. This not only improves your chances of getting more page views — it also enhances the visitor experience on your site.
To reap these benefits on your site, we’ll cover the different ways you can create and add a display of recent posts to your WordPress posts and pages. Let’s get started.
How to Display Recent Posts on Any WordPress Post or Page
There are a number of ways you can display a list of recent posts inside your WordPress posts and pages. You can use the built-in default widget to display the list in your site’s sidebar. If you’re looking for more flexibility, then you can install a plugin to create a custom list of recent posts. Or you can add code to your theme's functions.php file.
We’ll walk through each of these methods below so you can choose the one that best aligns with your technical experience. Let’s begin with the easiest method: using the recent posts widget in WordPress.
Display Recent Posts with WordPress’s Built-in Widget
WordPress’s built-in recent posts widget is easy to use for site owners at all skill levels. In exchange for this simplicity, however, you’ll be limited in functionality.
To start, simply log in to your WordPress dashboard and click Appearance > Widgets. Drag and drop the widget labeled “Recent Posts” into your sidebar.
In your sidebar, click on the widget to expand its settings. Here, you can provide an alternate title to the widget, display the publish dates of each post, and choose the number of posts you want to display. Once you’ve made these changes, click the Save button to store the widget’s settings.
While this widget is limited in functionality, it may meet the needs of your site. If you need more customization options, however, or would like to display this list anywhere other than in your site’s sidebar, then you can use a plugin. Let’s look at the recent posts plugins below.
Plugins to Display Recent Posts in WordPress
The built-in widget may be too basic for your site. You may want to display thumbnails and excerpts with your recent posts, for example, or limit the posts displayed to specific categories or tags. In that case, you can use one of the plugins below.
The Recent Posts Extended widget provides more customization options than the built-in widget, which gives you more control over the display of recent posts on your WordPress site. You can include custom-sized image thumbnails and excerpts for each post in the display. You can select the order in which posts are displayed, limit which categories and tags these posts can be pulled from, and much more.
Take a look at all of the plugin’s settings below. (Note that the posts are set to display in descending order and by date, which means the latest posts will appear first.)
If you’d like to display a list of recent posts anywhere else on your site — say, at the end of a post — you can use the shortcode that comes with the plugin: [rpwe].
You simply need to copy and paste this shortcode into any post or page to display a list of your five latest posts. Below are just two options for configuring the shortcode to customize the list of posts.
The Smart Recent Posts Widget is similar to the Recent Posts Extended widget. It allows you to display a list of your latest posts with thumbnails, excerpts, and publish dates included. You can also decide what order the posts are displayed in and limit the display to posts from particular categories and tags.
What sets the Smart Recent Posts Widget apart is how well-organized its settings are. With this plugin, you can fill in the information for one tab and then click on the next, saving changes as you go.
The disadvantage of using the Smart Recent Posts Widget plugin is that it does not come with a shortcode. That means you can only use this widget to display a list of recent posts in the sidebar of your site.
If you’re looking for the customizability of the Smart Recent Posts Widget combined with the flexibility of the WordPress Recent Posts Widget Extended plugin to display recent posts anywhere on your site, you can add code to your WordPress theme. Let’s walk through the steps below.
Display Recent Posts with Code
If you’re a more advanced user, you can manually display recent posts on your site by adding code to the functions.php file of your theme.
To access this file, log in to your cPanel account with your web host and click on the File Manager. Open your wp-content folder and find your themes folder. Right-click to edit it.
Make sure to replace 'yourcategoryslug' in the third line with the category you’d like the posts to display from. And, if you’d like to display a certain number of posts, just change the “10” in ‘posts_per_page’ => 10 to the number you want.
Adding this code snippet to your functions.php file will enable the shortcode [categoryposts]. You can copy and paste this shortcode into any WordPress post or page to display a customizable set of posts from your WordPress database.
Creating Your Display of Recent Posts
Using any of the methods above, you can display a list of recent posts within your WordPress posts and pages. Choose the method that best meets your site’s needs and aligns with your technical experience.
Because making a mistake in the functions.php file can break your site, adding code is only recommended for users with some coding knowledge. If you’re a WordPress beginner, then we recommend the built-in widget or a plugin.
Originally published Jan 10, 2020 2:52:31 PM, updated January 10 2020