Posts from — October 2012
Changes at the top of the page
More or less since we moved this site from being a conventional static web site to a WordPress environment based around the Thesis meta-theme, the header image has been randomly selected: each time you visited the site, you would see a different image.
This is actually very easy to do — there is a tutorial here — and it’s worked well. However, the other day I thought it would be rather neat for the header to consist of essentially a slideshow of the available images, gently crossfading.
One of the neat things about WordPress is that there are a great many plugins out there, many of them free, which you can locate to do things like this. For the Radio Riel site, I used a plugin called the Smart Slideshow Widget, for example (it replaced a rather fiddly flash slideshow that I used on the old RR site). The widget appears in the left sidebar to display a continuous and randomly-rotating set of logos for the station’s sponsors. However, this system only provides a widget: you can’t use it for a header image.
Go and search WordPress plugins for slideshows and you will find a great many, but most of them are a lot cleverer than I wanted. I just wanted to be able to stuff a set of images in a folder and have them display for a set period and crossfade over a set time. I definitely wanted to avoid flash (if I didn’t, I already have the tools to create flash slideshows, but flash is… a pain). This left me essentially with Javascript as the way to do the crossfading, and JQuery (already running on this site) or one of the other libraries will do that and lots more.
Many of the slideshow systems used the standard WordPress media upload system, which again was rather more than I needed. I started to install one of them and noticed that it messed with the Featured Image feature of WordPress. This rather warned me off, as I am already messing with the Featured Image capability to get it to work with Thesis — I’m using WordPress Featured Image for Thesis Theme from Thesistut, and I didn’t want to mess that up. And anyway, it was more complicated than I needed.
I finally found what I was looking for in the form of Cimy Header Image Rotator from Marco Cimmino. The plugin gives you some useful display options, such as a “Ken Burns Effect” instead of a simple crossfade — that’s the rostrum camera effect used extensively by film-maker Ken Burns, notably in his landmark series The Civil War (and now apparently a requirement for any PBS documentary), where rather than simply display a static image, you gently zoom in on it. The plugin also lets you include a caption and a link — either for all the images or for each.
The plugin has an upload folder (and you can actually upload additional files right in the plugin, which was a bonus) and once you’ve defined the parameters you get a bit of code to copy and paste into the appropriate Thesis hook (if you’re using Thesis), in my case the hook after the header. I replaced the existing random static header code with the new piece and it worked straight away.
Of course I wanted to tweak it a bit. I needed to change the size and position of the header image panel a little, which was easy, and wanted to alter the way the captions were displayed. The default is a little black lozenge (aka a round-cornered box) at the centre bottom of the image with the text in white. I tried dropping the lozenge and using a CSS drop shadow in black behind the text to pop the caption out of the image, whether it was dark or light, but the drop shadow wasn’t strong enough to do the job on really pale backgrounds. Eventually I lowered the caption to just under the image and made it black.
More tricky (and unsolved currently), I wanted to move the caption to be ranged left rather than centred. Unfortunately, the caption is positioned with respect to the entire browser window, and I have the page centred in the window so if you enlarge the window you get more air around the page equally on either side. This is fine if the caption is centred, but if it isn’t, you can’t define the location of the caption relative to the image. I will sort this out another day. In the meantime, enjoy the pics.
October 19, 2012 Comments Off on Changes at the top of the page