Tag Archives: coding

WordPress Plugins

Wrote my first WordPress plugin today (for www.bookthing.co.uk), it’s a pretty simple plugin architecture especially if you’re not trying to do anything too clever.  I just wanted a shortcode (some text you put into a post which is expanded by a plugin) to read some values from some custom fields and include them in the article footer.  It saves having to paste lots of formatting HTML into each post and lets you just suck content from the custom fields.

I was surprised I couldn’t find a simple ‘template’ style plugin on the WordPress site, maybe I was just using the wrong search terms.  It’s the kind of thing that would be very useful for building common information boxes for reviews, etc.  Anyway, I hacked together a 59 line php file, of which around 1/3rd is info and license to read two custom fields and whack them into a div.

Took about 9000% less time than I expected.