Purchase OIOpublisher now for just $47.

Take control of your ad space.

Click here to purchase

  1.  

    Hi Simon,

    I have set up a site and gradually added lots of different ad spots all on different pages, using the javascript option, but now I find myself with 20 widgets and it's very confusing if something goes wrong!

    I think I need to change to the subid method and set up a left column zone and a right column zone, and use subids for the different single pages, categories and groups of pages.

    Since we don't want people to be able to click on a spot to book it, we want to manage that ourselves, I'm just wondering how to set up the subids?

    Also, am I able to do it with javascript in just 2 widget areas, as opposed to my current 20 or so widgets?

    Thanks for your help,

    Belinda

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeMar 27th 2013
     
    Project Admin

    If you don't want people to be able to book slots, then you just need to ensure that the ad zones don't have a price set - which will stop that being possible (with or without subIDs).

    Your javascript might look like this (using banner zone 1 as the "left" widget example):

    <?php $subid = ''; //your unique page identifer goes here ?>
    <script type="text/javascript" src="/path/to/oio/js.php?type=banner&zone=1&subID=left-<?php echo $subid; ?>"></script>

    Need help?  Quick start guide | Troubleshooting | All help topics
  2.  

    Sorry, I'm hopeless with php, I might have a list of 10 subids here, do you mind giving me an example of how that might look.

    Need help?  Quick start guide | Troubleshooting | All help topics
  3.  

    OK here's my attempt, if correct would all of this go in a single widget?

    <?php $subid = 'homeleft'; //page-id-386 ?>
    <?php $subid = 'nswopenleft'; //page-id-688 ?>
    <?php $subid = 'nswsshipleft'; //page-id-686 ?>

    <script type="text/javascript" src="/path/to/oio/js.php?type=banner&zone=1&subID=left-<?php echo $subid; ?>"></script>

    Thanks for your help,

    Belinda

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeMar 28th 2013 edited
     
    Project Admin

    The subid needs to be dynamically generated, based on the page the user is currently viewing. In the code you have above, you're trying to hardcode 3 subids at once, but that will just lead to every page on the site using the same subid.

    Assuming you want to use the page / post name as the subid, I think this might work (not tested):

    <?php
    global $wp_query;
    $subid = $wp_query->queried_object->post_name;
    ?>

    A couple of additional points

    1.) Your widgets must support the execution of php code, which WordPress doesn't allow by default. Try this plugin, if you don't have anything that enables php in widgets already.

    2.) The script tag I gave you in the example is just an example, and won't work on your site (since it needs to include your site's own url). You should use the javascript ad code that OIO generates for you in the admin area.

    Need help?  Quick start guide | Troubleshooting | All help topics
  4.  

    Thanks! Will give it a go.

    Cheers,
    Belinda

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeApr 2nd 2013
     
    Project Admin

    No problem, hope it helps.

    Need help?  Quick start guide | Troubleshooting | All help topics