Start a new topic
Answered

Add a banner to all page headers except home page

Hi, I have a banner widget placed in the header widget of my site. I'm trying to figure out a way to show it on all pages EXCEPT the home page. Any suggestions on the best method to accomplish this?


Thanks,

Chris


Best Answer
Thank you Christopher, the issue was that the code (I just noticed) was not echoed correctly. Your code should now work.

 


Hi Christopher, I would warp the code for the banner on an if statement that checks the $pars variable. The $pars variable is used to check the URL of the page, so for example, if you did not want the banner to appear on your "about page (eg: mysite.com/about), then for this case the $pars[0] would be equal to "about", so an if statement would be:

if ($pars[0] == 'about') {
   Do something else and not the banner
} else {
  Print the banner in all of its glory!!
}

I tired adding that into the banner widget I made but it doesnt output anything.

Heres the code:
<?php
if ($pars[0] == 'home') {
   print "nothing";
} else {
	<div class="banner">
	<!-- [conversion] -->
	<img src="http://ab167268.adbutler-exciton.com/convtrack.spark?ID=167268" width="1" height="1" border="0" />
	<!-- Top Banner Ad [async] -->
	<script type="text/javascript">if (!window.AdButler){(function(){var s = document.createElement("script"); s.async = true; s.type = "text/javascript";s.src = 'http://ab167268.adbutler-exciton.com/app.js';var n = document.getElementsByTagName("script")[0]; n.parentNode.insertBefore(s, n);}());}</script>
	<script type="text/javascript">
	var AdButler = AdButler || {}; AdButler.ads = AdButler.ads || [];
	var abkw = window.abkw || '';
	var plc194925 = window.plc194925 || 0;
	document.write('<'+'div id="placement_194925_'+plc194925+'"></'+'div>');
	AdButler.ads.push({handler: function(opt){ AdButler.register(167268, 194925, [728,90], 'placement_194925_'+opt.place, opt); }, opt: { place: plc194925++, keywords: abkw, domain: 'ab167268.adbutler-exciton.com' }});
	</script>
	</div>
}
?>

 

 

Hi Christopher, could you please show me in what widget and page are you using this code?

 

Hi Luis,

Heres a couple screenshots of the widget and page where the widget is placed.

 

png
jpg
Answer
Thank you Christopher, the issue was that the code (I just noticed) was not echoed correctly. Your code should now work.