WordPress Images Linking to Posts

I wanted thumbnails in the ephemera sidebar, to link to the posts. This post helped a lot with getting the thumbnail-sized image. Plenty of other sources could give me the URL for the big image, or the thumbnail for the Featured Image, but those weren’t what I wanted.

Back to a Standard Theme

Recently, PigPog has been using a completely custom-written theme. It wasn’t too much work to write the basics, but I had lots of plans for updating it to include special handling of different post formats, and other things, so it would do a much better job of showing off photos, and could keep little updates (like this one) out of the way of ‘real’ blog posts and articles. None of the plans ever happened, because it was just more work than I ever wanted to spend the time on. So it just sat there, unused and barely loved.

Now, I’ve switched it all the way back to the default Twenty Eleven theme, with just a few relatively small tweaks to the CSS. And this time, I’ve made the small tweaks in the nice official way, by creating a child theme. That way, when the theme gets updated, I shouldn’t have to do any work.

So far, we’re both quite happy with it. It looks nice enough, and gives us support for some features that have been stopping us using this site. No idea if that means we’ll actually start posting here again, but it’s worth a try.

Front Page Image

One of the things we wanted with the current redesign was to have a simpler homepage – less busy, without the mass of posts and links. We also wanted to get a decent sized photo up there as soon as people arrive.

I was inspired somewhat by Inspiredology’s post on sites with large photo backgrounds. We haven’t gone that far, but the photo is the biggest element on the page.

I wanted to rotate images randomly, though, so people could see different ones, and a range of images would show up on different visits.

Showing a random image with PHP is something I’ve coded myself before, but I figured it would be easier to Google for one than either write from scratch, or even try to dig out an old one I’d written before. The first one I found takes a different approach that I wouldn’t have thought of, and was easier to implement than what I was going to do – Matt Mullenweg’s Random Image Script. Matt is the guy behind WordPress, so he probably knows what he’s doing ;)

Redesigning for Performance

PigPog hasn’t performed well for a long time. Pages have been taking a long time to generate, and a long time to download and display.

I’ve designed a new theme today, keeping it very simple. The result is that pages take around a fifth as many database queries to generate, and are created in a fraction of the time by the server. The difference seems pretty noticeable. The front page doesn’t display any posts any more – it’s just a static introduction.

I’ll probably continue tweaking it a little, but I like the simplicity, and I like the speed.