Forums

Variable sidebar content trouble (3 posts)

  1. lola rennt
    Member
    Posted 9 months ago #

    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.

  2. lola rennt
    Member
    Posted 9 months ago #

    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.

  3. lola rennt
    Member
    Posted 9 months ago #

    Can somebody help me?

Reply

You must log in to post.

About this Topic