How to display posts outside of WordPress

WordPress is built upon a collection of powerful core APIs. You can actually load the core APIs into any PHP application, just like any other library. It is quite simple to do, you need to include the file wp-load.php where ever you want to include the WP core API.

Assuming your blog is located in /user/var/www/html/blog, the single line below loads in WordPress API into your non-wordpress application.

Once the wp-load.php file is loaded into your code, you have access to the WP API. For instance, you can query the database for the recent blog posts, and display them where you did like show on your website.

By Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.

0 0 vote
Article Rating
Notify of
Newest Most Voted
Inline Feedbacks
View all comments
Abdul Manan
Abdul Manan
1 year ago

I’m facing the following issue
Warning: require(): https:// wrapper is disabled in the server configuration by allow_url_include=0 in C:xampphtdocswordpressindex.php

Ramya Shankar
Ramya Shankar
1 year ago

nice basic info. thank you