At Modernwp, we present final modified date as a substitute of authentic printed date for all of our articles. We predict it's dangerous thought to remove dates from your WordPress blog posts. In case you are utilizing final modified date, then you definitely may wish to present a listing of your not too long ago up to date posts in your website. On this article, we are going to present you learn how to show a listing of final up to date posts in WordPress.
Every time you replace a submit, WordPress shops the date and time of that replace within the posts desk as final up to date date. We are going to present you learn how to create a customized WordPress question to record your most not too long ago up to date articles.
Copy and paste this code in a site-specific plugin or your theme’s capabilities.php
file.
perform wpb_lastupdated_posts() //add a shortcode add_shortcode('lastupdated-posts', 'wpb_lastupdated_posts');
That’s all. Now if you wish to show final up to date posts in your theme’s template recordsdata, then you need to use it like this:
<?php if (function_exists(wpb_lastupdated_posts)) : wpb_lastupdated_posts(); endif; ?>
To show final up to date posts in WordPress posts, pages, and widgets, then you need to use the shortcode [lastupdated-posts]
.
There are various alternative ways to kind your articles in WordPress. Other than the ascending, descending, and random order, you may also show posts by expiration date. With this text, now you can present posts by the final modified time.
How would you utilize this in your website? Are you displaying authentic printed date or final modified date? Tell us by leaving a remark beneath.