Hi I have some trouble constructing a variable sidebar.
On my theme I use a variable sidebar that displays all the posts. On the homepage it displays all the posts, on the category archive it displays the posts of that category. So far all good.
My problem now is that when I am in the category template and I click on a post, my sidebar relinks me to my index.php file by which the selection in the sidebar is lost. It should keep that selection of the category archive - but WordPress links to the single.php file. How can I force the sidebar to either stay in the category archive or retain that selection?
Here is my code for the sidebar:
<?php
if ( is_category('editie') ) {
include 'sidebar-cat-editie.php';
} elseif ( is_category('publicatie') ) {
include 'sidebar-cat-publicatie.php';
} elseif ( is_category('tentoonstelling') ) {
include 'sidebar-cat-tentoonstelling.php';
} else {
include 'sidebar.php';
}
?>
And here is a link to the online version: http://www.thecitizenspeech.com.web02-shared05.priorweb.be/ Click on the E, P or T to visit a category archive, then click on the post to see what happens.