I’m using Jigoshop and WordPress.
My main goal is to load a different sidebar in different product categories.
I’ve managed to do this by using :
function jigoshop_get_sidebar() {
if(is_shop()) get_sidebar('shop'); if ( is_product_category('poura'))
get_sidebar('cigars');
}
in my functions.php file.
Now the issue is that I have some products that are in not just one category, so when I try doing something like this:
function jigoshop_get_sidebar() {
if(is_shop()) get_sidebar('shop'); if ( is_product_category('poura'))
get_sidebar('cigars'); if ( is_product_category('cigarillos'))
get_sidebar('shop');
}
I now get both of the sidebars (‘cigars’,’shop’) because some products share both the category ‘poura’ and ‘cigarillos’.
How is it possible to have just one sidebar under these circumstances?
Thanks again for any help!
An “else if” statement is not resolving your problem?
Basically what i meant was the you need a switch case not a lot of different ifs.