• 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lola rennt

    (@laurenserge)

    Basically I would need something like wordpress/archive/category/single
    I know this does not exist, but how can I tell my sidebar that if the single.php is reached from a category archive it should retain that specific sidebar for the categoyr archive?

    Any help is welcome, even just a simple direction.

    Thread Starter lola rennt

    (@laurenserge)

    Can somebody help me?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Variable sidebar content trouble’ is closed to new replies.