Displaying recent posts in your WordPress website has many additional advantages. You can hook your viewers into other consecutive contents which will result in the increased page view time and reduced bounce rate. Recent posts widget helps the visitors to easily find the new and updated articles. This works like the sitemap of recent posts for viewers. You can display the recent posts list in sidebar, footer and in any other widgetized areas. You can also insert it at the end of every post and even in the middle of your contents. We will show various simple ways to show the recent posts in WordPress.
Simple Ways to Show the Recent Posts in WordPress
Using the built in recent post widget in WordPress
The easiest way to display the recent posts list on your website is using the WordPress built in recent post widget. Although the built in recent posts looks simple and has limited functionality, it can do your job in many cases. First, log in to your admin dashboard. Go to Appearance > Widget. In the left-hand side, you will find the group of available built in widgets. Search for the recent post widget and add it to sidebar or footer or any other widget ready area. You can simply drag and drop the widgets from left to right.
There are just three customization options, which you can set. You can give the title of your Recent Post widget and enter the number of posts to display. Select the check box if you want to display the publish date. Finally, click save button to save the settings.
This should be enough to show your recent posts widget. Here is what the default recent post widget looks in the twenty-seventeen theme.
Using Plugins to Display Recent Posts
The default recent post widgets lack some important features like showing thumbnail and excerpt. If you want some more features in your recent post then you can use a plugin called Recent Post Widget with Thumbnail. There are many other plugins available in WordPress repository which you can experiment and use. We are using this plugin because it is simple and works like the extended version of default recent post widget of WordPress. This a popular plugin with high ratings. To install the plugin navigate to Plugins > Add New. In the Add Plugin Page, search for Recent Post Widget with Thumbnail keyword in the search field. Install the plugin shown in the picture.
After the plugin is installed and activated, go to Appearance > Widget. Now you can see the new widget called the Recent Post With Thumbnails. Simply drag and drop that widget in your active sidebar.
When you add the widget to the sidebar you get a very long list of setting options. The customization options give you full control on how you want to display recent post. You can show thumbnail, sticky posts, excerpt, date, author and so on. The settings are simple and self-explanatory. Once you have made the necessary customization click save button to save the settings.
Here is what the recent post widget with thumbnail looks like.
Manually displaying recent Files
In the list of simple ways to show the recent posts in WordPress, our next method is manually using codes. If you are comfortable with writing codes then, you can manually create and display the recent post widget with just a few lines of codes. You can use WP_Query class. Here is a simple example code to display the recent post and excerpt using WP_Query. You can extend this code and add it to any place where you want the recent post to appear. You may also have to do some styling using CSS to blend it with your theme.
<ul> <?php /* Define our WP Query Parameters */ $the_query = new WP_Query( 'posts_per_page=5' ); ?> <?php /* Start our WP Query */ 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> <li> <?php the_excerpt(__('(more…)')); ?> </li> <?php /* Repeat the process and reset once it hits the limit */ endwhile; wp_reset_postdata(); ?> </ul>
We hope this article helped you by showing you the simple ways to show the recent posts in WordPress website. Here is the list of some more articles that you might be interested in.
- Show Related Posts in WordPress Using Recent Posts Widget Extended Plugin
- Show Related Posts in WordPress with Advanced Random Posts Widget
- Show Related Posts in WordPress with Flexible Posts Widget Plugin
- Show Related Posts using Genesis Featured Widget Amplified Plugin
Latest posts by Kantiman Bajracharya (see all)
- What are Different WordPress Theme Licensing Terms? - December 21, 2017
- 4 Tips to Optimize Your WordPress for Social Media Share - November 30, 2017
- What is WordPress? Is WordPress Free? Why is WordPress so popular? - November 22, 2017