This is a longish story, but stick with it. My site has a ‘top’ menu with three sections: news, images, timelines. Each section calls in a different stylesheet and different submenu. The code in the header looks a bit like this (a series of separate IF statements):
if (is_page(array(403, 401, 412, 414, 416, 102)) || is_attachment() || in_category(1) || is_tax (array('media-tags', 'people')))
if (is_page(array(423, 425, 440, 442, 845)) || in_category(array(141, 142, 143, 262)) || is_tax (array('news-tags')))
do something else
if (is_page(array(444)) || is_tax (array('project-name')))
do something different again
Posts can be tagged with one or more custom taxonomies.
The problem is with the timelines. The Timelines Page/section is a list of terms in a custom taxonomy (project-name). Choosing one of those terms brings up a list of all the posts (and custom posts types) tagged with that term. Trouble is, along with the list of entries, the stylesheet and menu relating the first item in the list is also pulled in. So if the first item was an event I’d get the Images sub-menu as well as the Timelines one.
I need all the elements in each of the IF statments to make each of those sections work properly (with the right css and sub-menu), so pulling them out isn’t an option. Changing in_category to is_category, for example, breaks the styling.
Each custom taxonomy calls its own taxonomy-whetever.php template file, and the correct one if being pulled in. It’s just the IF statements, I think, where I’m going wrong, but I can’t see where.