in ,

Display Recent Posts in WordPress


Many times we need to display recent posts on side bar or content page of WordPress blogs. If it is for side bar, we can use existing widget to display recent posts. But for content we need do some PHP code modification. You can use this code on any play where you want to display recent posts

Add recent posts in WordPress with PHP

So Here I am adding some ways to display recent posts on WordPress

Display Only Title of Recent Posts

If you want to display only titles of recent posts, you can use following code where you want to display the posts.

Here number 10 represents the number of post which you want to display.


Displaying Recent Posts with Summary

Sometimes, we are interested in showing post summery along with the titles of recent posts. For this, we can use following code.

Here you can change the number 250 to any number. It represents the number fo characters of summery that will be displayed along with the title of recent posts.

If you think there are more easy ways to show recent posts on the page, you can share with us.

If you like this post, share it with your friends on various social media websites.


Written by Deepanker

Deepanker Verma is the founder of Techlomedia. He is a tech blogger, developer and gadget freak.

Leave a Reply

Your email address will not be published. Required fields are marked *


whatsapp desktop app

How to Block Specific WhatsApp Contacts on Android

What is Google Page Layout Algorithm?