Home>Support>Adding banners to each post/page/archive

Adding banners to each post/page/archive

Hi There,

For my blog (www.bbq-junkie.nl) I’m asked to place some scripts that are needed to show ads on every page, including posts, all pages and archives. But I’m not really sure how to do this and where to place the scripts.

Can you guys help me out? Below the scripts that I need to place.

— script below menubar —

<script language="JavaScript" type="text/javascript">
<!--// <![CDATA[
if(window.innerWidth >= 980) {
  placebanner('728x90,970x90',sZone+'/header');
}
else if(window.innerWidth >= 760){
  placebanner('728x90',sZone+'/header');
} else {
  placebanner('320x50,320x100,320x240,300x50,300x100,300x250',sZone+'/header');
}
// ]]> -->
</script>

— script above footer —

<script language="JavaScript" type="text/javascript">
<!--// <![CDATA[
if(window.innerWidth >= 980) {
  placebanner('728x90,970x250,970x90',sZone+'/footer');
}
else if(window.innerWidth >= 760){
  placebanner('728x90',sZone+'/footer');
} else {
  placebanner('320x50,320x100,320x240,300x50,300x100,300x250',sZone+'/footer');
}
// ]]> -->
</script>

Thanks in advance!

Roy

This is a free community support forum. Replies are not guaranteed. If you need professional email support, please purchase a SiteOrigin Premium license.

  1. 10 days, 6 hours ago Alex S Hi, I Work Here

    Hi Roy,

    Unfortunately, this isn’t possible without a fair amount of custom coding – you’ll need to use a child theme for this. This is beyond the scope of what we can help you with on our forums, but you could hire a developer to implement this for you.

    We recommend using Codeable. You’ll be able to hire someone at an hourly rate to do this work for you.

  2. 10 days, 3 hours ago rschalkwijk

    Hi Alex,

    Thank you for your reply. After starting my thread I continued trying.

    I already have a child theme and have managed to show the banner on top of each page by adding the script to the header.php. Only problem now is the alignment of this banner.

    Now I only need to know in which .php file I need to add the bottom banner, that comes above the footer.

    Maybe you can help me with this?

  3. 10 days, 2 hours ago Alex S Hi, I Work Here

    Hi Roy,

    Copy footer.php to your child theme and add your code after (or before):

    <?php do_action( 'vantage_before_footer' ); ?>
    

    Regarding the alignment, I’d like to help you with this but, unfortunately, this is beyond the scope of the support we’re able to offer on our free forums. Sorry mate.

    We do offer this level of support to our premium users, so if you’d like to upgrade to SiteOrigin Premium, then I can help you over email support.

    If you’d prefer not to upgrade to SiteOrigin Premium, then you can hire a WordPress developer from Codeable. They’ll charge you an hourly rate for any work done.

  4. 9 days, 20 hours ago rschalkwijk

    Thanks Alex, copying the footer.php made it work. The alignment I was thinking in to difficult solutions, and found out how to manage this :)

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More