I'm trying to turn off certain banner boxes in specific categories. I have achieved part of what I want to do by using
PHP Code:
if ($show_banner_box2 = true && (!in_array($current_category_id, array('1','53','4','2','3','47','55','57','56','54','48','49','50','51')))){
// show it
$show_banner_box2 == true;
} else {
// do not show it
$show_banner_box2 == false;
}
in includes/modules/sideboxes/my_template/banner_box2.php,
but was hoping someone would be able to help me reduce the query time on this statement (as it is a very long with the other banner box that I'm using).
I can't figure out how to exclude just a top level category instead of having to exclude the top level category and all the subcategories.
I've tried using $master_category_id, $category_id, $top_category_id as well as $categories_id and I'm outta ideas. I've hunted through other posts, trying to figure out which "$" controls the top level category, but can't seem to find what I'm looking for.
I'm not proficient at coding but I've got google, so feel free to be as technical as necessary.
Thanks in advance!