Witty and insightful observations on the world? Sorry to disappoint, this is a techie blog purely for self reference - published online in the hope it will help others!

jScrollable Custom scroll bars

I'm working on a nice little Wordpress job today. The designs are great, but the designer hasn't really catered for variable content heights (it's a list of items driven from a post category, each one has a little drop down box which displays the full post content). Something I see quite a lot to be honest, the designer uses the same piece of Lorem Ipsum for each section - that's fine but it's a CMS and the client is going to be sticking in all kinds of different content which will need to be catered for. We are left with the following list of options; The client has to create content which is exactly the same length as the ... Read more

jQuery UI in WordPress

I normally just dismiss the Wordpress 'Welcome' screen and disable it in the Screen Options menu for the Dashboard. However, I realised this wasn't actually very sensible for a pro Wordpress developer as it shows you what's new and what you should be aware of. As it turns out I noticed on this feed that they now ship the jQuery UI library with the Wordpress core, so you can enqueue it and use it straight from your functions.php file. Simple, eh? Well not really to be honest, mainly because it's not that obvious how to do it (or at least it wasn't tonight, on 05/06/2012). Seasoned users of jQuery UI will know you can build your own ... Read more

Custom Metabox for Specific Category

There are various ways of handling metaboxes and post category types in Wordpress. If time allows it's often better for the clients if you can create custom post types for specific categories and then add in meta boxes specific for those post types. Occasionally that can feel a bit heavyweight, depending on the application. A quicker and easier way to do it is to create a normal post category and then display your metabox only if the user checks that category in their post edit screen. We do this using Javascript, the essence of it being that technically speaking the metabox is created and sitting there all the time, it's only displayed if the user checks the appropriate ... Read more

Pinterest WordPress RSS Widget in IE7

This is one of those painful IE7 tribulations (how much has Microsoft cost developers over the years with their awful browsers? - Answers on a postcard). Plugged it in and all working, then I realise during testing at the end that the thumbs are not being properly hidden in IE, despite the overflow on the parent div being set to hidden and the width and height specified inline via the Javascript. Teary hairy for about and an hour and a half trying everything, Les Aubery at Big Bang sorted it in about two minutes. The parent div might have had it's overflow set to hidden, but the CSS wasn't using it because the image itself had ... Read more

jQuery Backstretch

Thought I'd blog my first proper stackoverflow answer; http://stackoverflow.com/questions/7125499/use-backstretch-inside-a-division-and-reduce-width-to-width-of-division/10209027#10209027 Let's see it get downvoted into the bowels of the earth :) I wanted to use backstretch to fill an element which was full width but took up only the top 560px of the screen. And if the image had to be resized larger than the original it didn't recenter vertically but was offset so the top disappeared. Yes, the link above is correct, you change the container from the body to the element you want to fill, in this case it was #backimage; Then I changed the code to assign a ... Read more

prettyGallery & Magento

I really like the stuff that Stephane Caron does at No-Margin-For-Errors, he's published some awesome jQuery plugins. For my money prettyPhoto is the best lightbox out there, and I recently had need to put a small image slider in a Magento site for a client in West Yorkshire. The main Magento product image was to load in as a background image into a version of Scott Robbin's jQuery plugin Backstretch which I customised to work on a container rather than the body tag. The designs from the agency (who I can't mention - NDA) showed that additional images were loaded into a scrollable container further down the page, so I decided to use prettyGallery. ... Read more

Cufon in IE8

I don't use Cufon much these days, I prefer to use @font-face if possible.  I still use it from time to time though (say what you like, it does render the fonts absolutely beautifully) and of course I sometimes have to work on sites which have employed it. This is just a quick post because I came across an unusual situation this morning - a site which was failing to render menu items in Cufon in IE8 only.  IE7 and IE9 were fine, and allt he other fonts were displaying fine in IE8 - just this menu that was failing to. Found the solution in this Drupal forum thread .  Added the following CSS to the IE8 conditional stylesheet and all ... Read more