It turns out that it takes longer to write this post, than it does to add the PHP to list the recent WordPress posts, thanks to a few simple function calls wrapped in a loop to fetch the posts:
<?php require('./blog/wp-blog-header.php'); ?>
<?php query_posts('showposts=8'); ?>
<?php while (have_posts()): the_post(); ?>
<span><?php the_date('j/n'); ?></span>
<a href="<?php the_permalink(); ?>">
<?php endwhile; ?>
This is a vanilla WordPress loop construct with a few tweaks to suit my use here. The ‘showposts=8’ parameter limits the number of posts to be listed to 8 and the more cryptic ‘j/n’ parameter for query_posts, formats the date as day/month without leading zeros.
It is nearly a month of evenings and weekends later. As predicted, the real effort was in integrating and synchronising my static HTML pages with the WordPress PHP content. However, to be fair, it wasn’t all one way. I have changed some of the original website to match the TwentyEleven theme used by the blog as I preferred some of its styling over my original design!
I have to say, I like the clean use WordPress makes of cascading style sheets, which enabled a lot of cosmetic customisation without having to edit the PHP code directly. My last task is to replace the old news links on the index page with dynamic content from this blog. Hopefully there is a tidy way to do this!
I have been meaning to add a blog to the Michell Computing website for some time and now I have finally got round to trying out the WordPress install. It actually was surprisingly easy to add it to an existing website. The install wasn’t 5 minutes, more like 15, but very smooth none-the-less, so well done WordPress.
I suspect the real effort will have to go into harmonising the style with the main web site. I will post progress here and then be able to get on with the real business of developing GIS database systems in FreePascal and PostGIS!