In WordPress blog, our latest posts are publicized on the home page, and older posts access with the help of post page navigation. In this post, we are going to learn how to display our WordPress blog posts on any static or dynamic page using a simplexml_load_file() method with ATOM that works to get WordPress blog post details as XML data with domain link.

There is one pretty Impressive fact that every WordPress blog has “Atom” specified XML file it will only to serve the Data into other servers. Only we need to call it using a PHP method named simplexml_load_file() which simply stores the XML file and changes the file toward Pure XML Detail and then all the data can be accessed in object data format.

Step 1: Making connection with WordPress blog

Load the data into XML data object using simplexml_load_file() and Atom method. It will request to given URL link and get the dataset from it.

Step 2: Display the blog post details

Here we need to get the required details from XML object like Title, Published By, Published Date, Post Description and etc.

Final Code

Here the full final code to get WordPress blog post and show on our page.

Download   Demo

One Reply to “Get WordPress blog post and show in any page”

Leave a Reply

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