Embedding Images in WordPress
11 08 2008When I first created this blog, my un-optimized MySQL installation very quickly barfed and I had to re-compile and re-install it.
As it was brand-new, all that happened was that I lost my first few posts. I am now taking the time to re-write this particular one.
I really don’t get on with the WordPress Way of adding images to my posts. I’ve written a number of PHP functions that allow me to easily enter image data into my HTML with, for me, great ease. I therefore decided to create a similar function to allow me to insert images into my blog posts. And thus blotto was written. The clever-clever name is a sort of corruption of “blog-photo”.
This extremely simple function allowed me, thanks to the excellent Exec-PHP plug-in, to insert a pre-prepared thumbnail image of a photo and hook into Lightbox (another excellent plug-in) to display the full-size image. And to achieve this, all I needed to do was insert a single line of code in my post…
<?php blotto("Charlies_rear"); ?>
And hey presto! I get
It really didn’t take me very long to realise that I needed a number of variants of this function – and so I ended up with the following four routines.
- blotto – (blog-photo) Insert a lighbox’d photo in a post
- flickr – provide a link to a flickr set
- blink – (blog-link) Provide a graphical link to a web-page, internal or external
- baphic -(blog-graphic) Display a picture. That’s all
And so I re-wrote my blog_functions.php file to include these functions. And I also wrote a full set of documentation.








What an unfortunate choice of picture.. poor charlie!!! nice work though… I would move if I had the opportunity, but not the skill.
I recommend to subscribe to RSS place in a conspicuous place! Readers will be more! Especially at a blog, how are you! Tested – a 30% increased the number of subscribers!
I came across. Thank you.
Hmm. Good post.