How to Display Last Updated Posts in WordPress

Best WordPress Hosting

Whenever you update a post in your WordPress blog, WordPress stores the date time of that update. So, you can use this date to display posts on the basis of last update time. We have already posted how to display recent posts or display recent posts from a specific category. In this post, we will see how to display recently updated posts.

Open functions.php of the theme and add following code.

Above code is written only to display 5 posts. You can change the $counter limit to any value for increasing or decreasing number of posts.

Best WordPress Hosting with Bluehost

Now you only need to use this function when you want to display last updated posts. Just use the code given below on the page where you want to display posts.

If you have copied every thing right, you will see last updated posts.

You have already created shortcode for this. So, you can also display last updated posts with this shortcode [lastupdated-posts-wt].

Source: wpbeginner

Get your free WordPress blog here

advertisement

About The Author

  • ADD YOUR COMMENT

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!