Have a look at the Category conditional tags
Eg:
<?php if( is_category('3') ) get_sidebar('news');
elseif( is_category('7') ) get_sidebar('services');
else get_sidebar();?>
For clarification, when you do this..
if ($cat = array(3) ) {
You’re basically saying if $cat can equal to array(3) (which it can), then do.. (whatever follows)..
That statement will always be true.. $cat will always be set to an array with the value of 3 ..
At least i believe that to be the case (based on my understanding).
Esmi’s suggestion above should set you in the right direction though.. 😉
thanks t31os_ it makes it a bit more clearer for me.
I have looked at esmi’s link and half works, however i am not displaying a side bar.
My site is set up with Home, About, News being categories and ‘education, experience, skills’ are all posts that display in the ‘about’ category.
Therefore if the page is currently the about us cat(id3) i want the posts within this category to show 🙂
How is this different from using standard category pages?
Sorry i am not too sure what you mean?
Sorry – I was confused by your description of the situation. So is it that you want to show posts from 3 categories on the About category page? Or do you want to show different sub-menus on different category pages?
Hi
I want to show different sub menu’s on different category pages.
You can see the site here
To get the code I posted above to work, you need to have already created your custom sidebars – sidebar-news.php and sidebar-services.php in the example.