views:

242

answers:

2

Hi there, I'm trying to figure out a way of being able to click a link in a sidebar and skip straight to a single page if there is only one post in a category.

This is the website I've built for the company I work for. For example. If you click on the "Kings Theatre" link in the sidebar (under "browse by client") it goes to a category page with one item on. I would like to have this link directed at the single page.

Is there a way of linking straight to the single page if there is only one post in that category?

Here is the link:

http://www.oysterdesign.co.uk/category/work/

Thank you very much for your help.

+1  A: 

In the category template check for the number of elements in the $posts array. If there's 1 then include the single page template or else display the normal category listing.

Kwebble
A: 

oops it should have been a comment...

did you end up solving it? i need this to :)

shemtovo
I haven't got round to fixing it yet. To be honest I'm not sure my php skills are up to it. If you manage to get it working please stick it up.
Danny Tonkin