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:
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.
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.
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.
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 …