Ever needed to be able to access your WordPress data and run a loop OUTSIDE of your WP install? Here’s a code snippet which allow you to run a WordPress loop on any PHP file, even outside of your WordPress install.
Paste the following code on any PHP file where you want to run your WordPress loop. Don’t forget to modify the following:
line 4: Please specify the path to your WordPress wp-blog-header.php file.
line 5: Query posts using the query_posts() function.
If you enjoyed this article, please consider sharing it!