Calling different sidebar for different categories
-
Hi,
firstly let me clarify that when I say sidebar – I do not mean the dynamic sidebar which is included with wordpress themes.
Within my site I want to have certain categories call a custom ‘sidebar area’ which will contain posts from a different cetegory.
What I think I need (any better ideas let me know please) is some sort of if statement within the normal sidebar.php file which includes certain files…
In cat 3 (as normal)
get_sidebar() — (as normal)In sidebar.php – (as normal)
if is_category(3)
get_sidebar3() — sidebar3 will call a file sidebar3.php which will contain a new loop pulling in category 23 postsI know this sounds silly and I am open to any suggestions from you guys who are probably more experienced than me.
== I guess that I should explain the reasons behind this to help give input..
I am using WP as a CMS and I am using categories as the ‘pages’ for the site to allow for dynamic adding to etc.
I have set up a seperate category called sidebarCat which has sub-categories ie side1, side2 etc.
These sub-categories will be used to contain quotes, images, adverts etc (whatever is needed).So within some of the normal categories I want to include the posts from a particular sidebarCat sub-category eg side1…
I’m sorry this sounds confusing I think that I am thinking too complicated for this and hope that someone can either clarify what/how I should do this or give me a more simple method.
As always, any help would be great!!
- The topic ‘Calling different sidebar for different categories’ is closed to new replies.