Javascript Menu by Deluxe-Menu.com


Embedding Images in WordPress

11 08 2008

When 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.

Technorati Tags: , , , , , , , , , ,


Actions

Informations

4 responses to “Embedding Images in WordPress”

12 08 2008
Sage (17:36:29) :

What an unfortunate choice of picture.. poor charlie!!! nice work though… I would move if I had the opportunity, but not the skill.

6 11 2008
Rafik (02:11:15) :

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!

11 11 2008
dedits (13:28:50) :

I came across. Thank you.

12 11 2008
chiulink (05:14:55) :

Hmm. Good post.

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>




knot
Bear