Previously I have posted how to use the_post_navigation() in the custom template. In this post I will tell you how you can use Display Recent Post outside WordPress so let’s get started.

First, you have to understand the code will only work with PHP file so whatever file name you choose make sure it ends with .php, for instance, I will use recent.php you can also use some CSS to show some pretty stuff in this example I will only concentrate on the PHP code and you can use your own CSS but for you I am writing some CSS classes so you can take advantage of it.

Copy/Paste the code below and use it in your project.

Make sure to change line # 4 as per your WordPress installation directory

If you like this article please share it with your friends and your comments are always welcome.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: