Totally Zenned
- Join Date:
- Dec 2012
- Posts:
- 607
- Plugin Contributions:
- 0
Can I put some html content on the first page only?
How can you place html below the footer on the first page only?
Views: 1,999
Totally Zenned
How can you place html below the footer on the first page only?
Totally Zenned
Can the html be placed on the index.php page only, below the footer?
Totally Zenned
yes by using banner manager in your admin area, just add your html to your banner and set where you'd like it to display. There's a thread or it may have been a FAQ page too of how to set it to show on homepage only.
Totally Zenned
picandnix:
yes by using banner manager in your admin area, just add your html to your banner and set where you'd like it to display. There's a thread or it may have been a FAQ page too of how to set it to show on homepage only.
Thank you for the reply.
That could work for me, if I could make appear on the index first page only.
Totally Zenned
I am revising the following in tpl_main_page.php
<?php
if ($this_is_home_page && SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
if ($banner->RecordCount() > 0) {
?>
from Linda's (Ajeh) Post but I am still getting the banner on all pages, below the footer.
I am trying to make it show up on the first page / home page, below the footer only.
Administrator
Try wrapping this logic in
if ($this_is_home_page) {
...
Totally Zenned
I tried
<?php
if (($this_is_home_page) && SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
if ($banner->RecordCount() > 0) {
?>
also tried
<?php
if (SHOW_BANNERS_GROUP_SET3 != '' && $this_is_home_page && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
if ($banner->RecordCount() > 0) {
?>
No luck.
Totally Zenned
I went a head and installed a fresh Zen 1.5.1 to test. I modified the following code at line 104 and I am getting the same results. Banner at position 3, below the footer, shows up on all pages.
includes/templates/classic/common/tpl_main_page.php
<?php
if ($this_is_home_page && SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
}
}
?>
Totally Zenned
Totally Zenned
wrong banner?
<?php
if ($this_is_home_page && (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4))) {
Totally Zenned
swguy:
Try wrapping this logic in
if ($this_is_home_page) {
...
The opening bracket is missing in your conditional statement..
<?php if (($this_is_home_page) && SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { if ($banner->RecordCount() > 0) { ?>Kevin205:
I tried
Totally Zenned
I am using banner 3 for.
What do you mean wrong banner?
Totally Zenned
DivaVocals:
The opening bracket is missing in your conditional statement..
Where would the } close?
Totally Zenned
Kevin205:
I am using banner 3 for.
What do you mean wrong banner?
I meant different banner, but try the code I posted but for your chosen banner number of course.
Totally Zenned
picandnix:
I meant different banner, but try the code I posted but for your chosen banner number of course.
<?php if ($this_is_home_page && (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4))) { ``` I tried the following: ```php <?php if ($this_is_home_page && (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3))) { if ($banner->RecordCount() > 0) { ?> <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> ```picandnix:
wrong banner?
No it does not work. Thank you.
Totally Zenned
DivaVocals:
The opening bracket is missing in your conditional statement..
<?php
if ($this_is_home_page) {
if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
}
}
}
?>
Unless, I have written it wrong, it is not good.
Totally Zenned
I just found out something, when I place the Wide-Banner to Header Position 3, and with the following code, it works.
<?php
if ($this_is_home_page) {
if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
}
}
}
?>
Banner shows up in Header Position 3 on the index page and NOT on all other pages. (The code works)
But, the Footer Position 3 Wide-Banner shows up on all pages.
How is the footer section controlled?
Totally Zenned
Problem solved.
It is SHOW_BANNERS_GROUP_SET6 and not SHOW_BANNERS_GROUP_SET3
<!--bof- banner #6 display -->
<?php
if ($this_is_home_page) {
if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
}
}
}
?>
<!--eof- banner #6 display -->
It works fine now.
Thank you picandnix, swguy and DivaVocals.
Totally Zenned
By the way Ajeh's and picandnix's original suggestion works fine also. The numbers got me confused. In the admin I think it should be called positions 1 through 6. But I am sure there are a lot of other things to consider!
<!--bof- banner #6 display -->
<?php
if ($this_is_home_page && SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
}
}
?>
<!--eof- banner #6 display -->
That was a nice 5 hours.
Totally Zenned
Kevin205:
That was a nice 5 hours.
Well done :cheers:
Tell staff why this post should be reviewed.