Daily Archives: Sunday, 6th May 2012

Graphene Goodness

It’s about a month since I switched to the excellent Graphene theme, and so far it’s still making me happy. But there was one little thing I didn’t like.

I like the calendar-style date block the theme uses, but it doesn’t include the time of the post, which is something I like to display, if only to excuse any incoherence in posts made a little too late in the evening. So, today, I thought I’d have a look at adding the time. My first thought was to adopt a traditional approach, and edit the function that outputs the date. That was easy enough, but the trouble with that is that I’d either have to create a child theme (overkill for one little edit), or have to recreate my changes every time the theme gets updated (annoying, and I’d forget).

Then I looked at the theme options again, and realised that I’d just wasted my time. I’d seen the heading Action Hooks Widget Areas, but hadn’t quite registered what that meant, or how insanely clever it is. Basically, for numerous areas of the theme (pretty much any location you can see on screen), “hooks” are enabled, which is a generally useful programming trick to let functions insert content, or change content, or do other Clever Things. The difference in Graphene’s case is that you can select any of these hooks, tick a box, and you’ll then be able to insert any WordPress widget in the area corresponding to that hook.

And what does that mean? Well, if you use a text widget, or a PHP widget, you can stick any bit of text or code just where you want it, without having to edit any theme files or going to the trouble of creating a child theme. Brilliant.

I selected the graphene_post_meta hook then went to my widgets settings, where I added a new PHP widget (I use Otto’s PHP Code Widget for such things) with this simple bit of code:

Posted at <?php the_time('G:i'); ?> 

as the content.

Note that you’ll need to use the_time() rather than the_date(), as the latter will only show output for the first post displayed for each day.

And this pretty much sums up why I no longer bother attempting to create my own themes.

Weight and Stuff Report – 6 May 2012

Weight: 220 pounds (15 stone 10 pounds, 99.8 kg)
Exercise: A proper walk

Errr, what? Where did that extra kilogram come from? Most odd…

It was a wee bit sunny earlier, so I had no trouble persuading myself to go for a walk. I started with a tour of Saltwell Park, then walked into Gateshead to look at the construction site, then over the Tyne Bridge into Newcastle, where I wandered for a short while before getting the bus home.  Here’s the walk:

Park and town

Park and town

I took a few pictures, and here’s a sample for you. No, it’s not a repurposed chimney, it’s just part of Gateshead Library, as the lettering suggests

Library

Library

Camera: Canon EOS 5D Mark III
Aperture: ƒ/9
Shutter speed: 1/80s
Focal length: 32mm
ISO: 100
Location: 54° 57.0879′ 0″ N 1° 36.0652′ 0″ W

While I was out, I had a bit of a play with the Lensbaby, using my recently acquired Edge 80 optic to try for some interesting effects, such as this one:

Toy Park

Toy Park

Camera: Canon EOS 5D Mark III
Shutter speed: 1/1600s
ISO: 100
Location: 54° 56.6759′ 0″ N 1° 36.3741′ 0″ W

It was interesting to have to focus manually, and getting the right exposure needed some thought.

This one shows some nice shapes in the out of focus background.

Bokeh!

Bokeh!

Camera: Canon EOS 5D Mark III
Shutter speed: 1/800s
ISO: 100
Location: 54° 56.5292′ 0″ N 1° 36.3639′ 0″ W

More pictures when I find a tuit…