WordPress snippet #1

Useful little piece of WordPress code, plays a particularly useful part of a dynamic featured post slideshow that I was going to detail at some point. To reference the  set upload directory url in your WordPress theme:

<?php $upload_dir = wp_upload_dir(); ?>

<?php echo $upload_dir[‘baseurl’]; ?>

more info here http://codex.wordpress.org/Function_Reference/wp_upload_dir

Simplepie and integrating/parsing RSS feeds

Wow, how’s that for a snappy blog title!

Ok, I realise it sounds slightly dull but utilising RSS feeds can be a useful and relatively straight-forward way to include dynamic information within a site.

I’ve searched far and wide for various RSS integration tools and my favourite is by far and away a RSS parsing class written in php called Simplepie (http://simplepie.org/). Although this hasn’t been developed since version 1.2 was released in 2009 it remains the most straightforward and robust solution I’ve found.

Once you’ve downloaded and included the simplepie.inc file it’s so simple (excuse the pun) to use (here is a very good tutorial on how to set up a simple page featuring one feed). If you want to include multiple feeds there is some helpful info here.

But this is the best solution I’ve found to this particular problem – if you’ve got other solutions then please recommend!

Training, weeks 1-4

Right so apparently I’ve convinced myself that I’ve started training for the list of things I’m doing this year (details: http://www.justgiving.com/ashley-mann/). Annoyingly due to the slightly stupid way that things have worked out I effectively have to train for a 1000-mile bike ride and a marathon at the same time.

I’ve trained for a marathon before (read about it here and here), it’s no fun, it makes you hungry, tired and sore. Let’s see if cycling 100 miles a week helps that – I’ve been informed by a few people that it might actually be a good idea, cross-training n all that.

I’m yet to be convinced…

My training at the moment consists of trying to do at least 1-hour a day on the turbo trainer (bike) combined with trying to get out for a longer weekend ride on the road and trying to get my weekly running mileage up past the 30 mile mark. Which has met with mixed success thus far.

Ah well. 2 months to go…(eek)