Posted on Monday, 5th November 2007 by Shaun Kester

This is a simple tip, mostly for myself, with hopes that it will help a future googler. To show the three most recent article titles from wordpress in a non-wordpress page, do the following:

index.php (non-wordpress PHP page)

<ul><?php include(”GetNews.php”); ?></ul>

GetNews.php

<?php

require(’wp_directory/wp-blog-header.php’);
wp_get_archives(’type=postbypost&limit=3&format=html’);

?>

Simple enough if you want to just show headlines with links to the post page.

Posted in Tips and Tricks, Wordpress | Comments (0)

Leave a Reply