/ Published in: PHP

Grab 5 latest Wordpress posts and display them on a non-Wordpress PHP page.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // Include Wordpress require('./blog/wp-blog-header.php'); query_posts('showposts=5'); ?> <ul> <?php while (have_posts()): the_post(); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul>
Comments
