0

I’m currently redeveloping a site, and in the desire to keep everything as lightweight as possible, I’m developing it outside of WordPress and will only be using WP for the blog portion of the site.

I’ve basically got a directory structure like:

/_resources
index.php
/about/
/services/
/blog/
   /wp-admin
   /wp-content
   etc

I’m looking to create a “recent posts” feature on the homepage, and am wondering if there is a way to pull the post data out of WordPress and into my ‘out-of-WordPress-context’ pages. Any insight is greatly appreciated.

1 Answer 1

0

There are several ways to do it:

  1. SQL query to the wp database
  2. Using a Restfull API plugin: https://wordpress.org/plugins/json-api/ you will get the json of the posts.
  3. Using the RSS Feed (check this tutorial http://code.tutsplus.com/articles/how-to-read-an-rss-feed-with-php-screencast--net-1272)

To be very light you can cache the results will all options.
You can grab the results and cache that results for X hours/days depending on your new posts frequency.
So it will only make the request to one of the ways above when cache time as expired.

Cheers

1
  • All of these seem like viable options. Thanks a lot man, I appreciate your help!
    – zep_fan
    Commented Sep 25, 2014 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.