Disable Footer Banner all pages except Home
I have been trying to disable the banner for footer on all pages except the home or index page. I do not want it to show anywhere else. But have not been able to do it.
The layout is Banner Display Groups - Footer Position 1 for BannerFour. It is above my actual footer. This is what I input for includes/templates/my_temp/common/tpl_main_page.php.
HTML Code:
<?php
if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
if (SHOW_BANNERS_GROUP_SET4 == '') {
$show_banner_box = false;
}
if ($this_is_home_page) {
$show_featured = true;
} else {
$show_featured = false;
}
}
}
?></td>
And still showing up. Any suggestions? Kim
Re: Disable Footer Banner all pages except Home
You are using the wrong variables in your IF statement ... you need to use:
$show_banner_box
and you are using:
$show_featured
Re: Disable Footer Banner all pages except Home
Quote:
Originally Posted by
Ajeh
You are using the wrong variables in your IF statement ... you need to use:
$show_banner_box
and you are using:
$show_featured
I changed it to $show_banner_box and still showing on product pages...
What else am I missing??
Thanks,Kim
Re: Disable Footer Banner all pages except Home
Sorry, I was not paying attention to what you were really trying to do ...
In that file, you only need to change the 1 line:
Code:
if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
to read:
Code:
if ($this_is_home_page && SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
adding what is in red will only let the code run if on the Home page ...
Re: Disable Footer Banner all pages except Home
Perfect!
:clap::clap:
Thank you! Kim
Re: Disable Footer Banner all pages except Home
You are most welcome ... thanks for the update that this worked for you ... :smile: