That’s Two Down

November 24th, 2010

Well, I’ve just uploaded my second plugin to this site.  It’s not much, as it leans heavily on the built in link widget.  I wanted to list the links of the rest of my families websites in a specific order.  I could have hard coded it in, but that seems silly if there is a links function already built into WordPress.  But I couldn’t find anywhere to make a simple sorted list of a category.  Also, I am trying my hardest to avoid touching the core.  I don’t want to change something in a core file and then have an update erase it because that would be a nightmare to debug.  I can deal with a plugin I wrote using a depreciated function, that’s no big deal.

Another issue seems to be the lack of an ‘ordering’ variable in the links table of the database.  There is a ‘rating’ variable that seems to fulfill that function, but semantically that’s just wrong.  I wasted a lot of time thinking and reading about that…

In any case, you can now see at the bottom a nicely formatted and sorted list of links to my families websites.  I put up the main site a number of years ago, but it’s still serviceable.  Ben‘s site I’m proud of, and there are things I still want to improve on it.  I take no credit or responsibility for my parents online presence.

The first plugin I did last week.  I wanted a place to show picture from my blog, and have them link to their posts.  I searched all over the WordPress world looking for something applicable.  Why do yourself what you can download from the internet, right?  Well, all I found were large replacements for the built in Media functions that are intended for picture/photo blogs.  Well, that’s just not me.  So, I wrote my own.

It was actually quite easy and really contributed to my enjoyment of setting up this site.  I did have one little issue.  I decided that I didn’t want to code a new ‘lightbox’ JavaScript function, or really to even bother with it.  The issue here was that I wanted to be able to link from the images in this widget to their original posts so you can read about the image in it’s context, but images from the posts shouldn’t be linked to anything because they are already there.

I found that FancyBox for WordPress worked really well, and look good.  However, I couldn’t figure out how to make the pictures from the widget click-able.  I then found the Shutter Reloaded plugin, which isn’t styled as fancily, but was easier to manipulate.  Here I broke my WordPress rule about hacking other people’s code and made the picture title linked to the post it came from.  So now I have two lighbox plugins running, FancyBox for images in post, and Shutter Reloaded for images in the new widget.  It works.  Some day when I have the time and inclination, I’ll put together a complete lightbox plugin that looks good, organizes things well, and has the option of making the images linkable.

Tagged , , ,

What's this?

You are currently reading That’s Two Down at The Story of Abe.