We have created this useful guide to help fellow web developers provide a little more functionality to a website. Web designers and developers know that WordPress is built in server side technology called PHP and its very difficult to place PHP into a standard HTML page.
The only way to do this in the past was to use third party RSS Aggregators like SimplePie and MagPie to fetch your latest posts from your blog’s RSS feed. This could mean a lot more scripts and code than you actually need. So we would like to share some useful code to help develop your site.
First you need to tell your web server to allow PHP into a HTML file. Copy and paste this code into your htaccess file. (if you don’t know what your doing with htaccess files please be careful).
AddHandler application/x-httpd-php .html
<ul> <?php require($_SERVER['DOCUMENT_ROOT'] . '/folder/wp-load.php'); query_posts('showposts=3'); if (have_posts()) : while (have_posts()) : the_post(); ?> <li> <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <span>Posted on <?php the_time('l jS F, Y') ?></span><br /> <?php the_excerpt(); ?> </li> <?php endwhile; else: echo "no posts"; endif; ?> <?php wp_reset_query(); ?> </ul>