In this short tutorial, I’ll show you how to add the latest wordpress post to a page that isn’t under the wordpress directory.
Requirements:
1) For this to work, the page must be on the same server as the WordPress installation.
2) The page must be a PHP file.
Definitions – Put this before anything in your code, even the DOCTYPE.
All this does is call on WP and hit the query for latest post.
<?php
define(‘WP_USE_THEMES’, false);
require(‘../wp-load.php’); // This file is in the root directory of your WP installation.
query_posts(‘showposts=1′); // Number of posts to extract
?>
The Echo Read more
