Waiting

Sometimes I’m just desperate for a break, other times I can’t wait to go back to work. This is one of those times.

I feel like I’m rattling around the house waiting for Monday. Waiting for the IVF treatment to start again. Waiting for the days to lengthen, and more light, and more heat.

I’m trying to keep myself busy (reading, cycling, watching films) but I just want to get on and DO something productive.

Sigh

WordPress puzzles

I’ve spent much of today problem-solving a website project that I’m working on. I’ve decided to use WordPress to manage the site but need it to do a couple of things:

Navigation

The site has a number of sections, e.g. Home, About us, News, What we do, Contact us, etc. and I’d like the site to show the top-level navigation as a horizontal navigation bar just beneath the header, but show only sub-navigation for the current section in the right-hand sidebar.

In other words, if we’re in the About us section I want the right-hand navigation to show only sub-menu items from About us, e.g. Our History, How we are funded, Our year, etc.

I’ve managed this very simply using the Fold Page List plugin.

Custom styles

Next, I want to be able to apply a different coloured theme to each section, e.g. Home is green, About us is orange, News is red, etc.

In a good old fashioned hand-coded site I’d simply serve up a different CSS style sheet for each section, e.g. home.css would style the relevant parts of the page green, aboutus.css would style everything orange, etc.

Page-by-page

But how to do this with WordPress? I’ve found a plugin that will allow me to specify a CSS style sheet for each page, but this is done on a page-by-page basis rather than globally.

Page Template

I’d really like to be able to use the WordPress Page Template functionality for this — so when I select which Page Template is used, e.g. “About” then it automatically inserts the appropriate CSS file in the page header.

I suspect that I’ll have to write something custom using the wp_head() hook. I’d really like to write a plugin to do this, but my PHP skills aren’t quite as 1337 as I’d like them to be.

Ideally it would offer a configuration screen that reads in the template files, lists them on a page and allows me to specify which CSS file to link to which. Then the plugin does the magic automatically.

I’ll get working on this right away …