Integrate WordPress blog into your website

September 5th, 2005

As I reported two days ago, the news on galaxysoft.ch are now dynamically created from my WordPress blog. I’d like to share the small script I’ve written for this purpose. The blog class: blog aggregation class.

To use this you need PHP 5. The function grabRSS can then be called e.g. by grabRSS("http://www.example.com/blog/wp-feed.php", 5) to get the latest 5 entries of the WordPress blog located at www.example.com. Instead of just echo”ing the blog entries I decided to save them in an instance of the class BlogEntry and then to return an array of BlogEntry‘s. You can then for example use a Smarty template to really show them on your website.

Where I assigned the array the function grabRSS returned to the Smarty variable $WEBSITE_NEWS.

Comments are closed.