Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Spacetime

    (@spacetime)

    Yes, use the following code for block 1

    <?php
    if (rand (0,1)) {
    define ("AD1", true);
    ?>
    AD CODE 1
    <?php
    }
    ?>

    and the following code for block 2:

    <?php
    if (!defined ("AD1")) {
    ?>
    AD CODE 2
    <?php
    }
    ?>

    Make sure PHP processing is enabled for both blocks.

    Plugin Author Spacetime

    (@spacetime)

    Or more universal solution for more blocks:

    Block 1

    <?php
    define ("AD_BLOCK", rand (1,3));
    if (defined ("AD_BLOCK") && AD_BLOCK == 1) {
    ?>
    AD CODE 1
    <?php
    }
    ?>

    Block 2

    <?php
    if (defined ("AD_BLOCK") && AD_BLOCK == 2) {
    ?>
    AD CODE 2
    <?php
    }
    ?>

    Block 3

    <?php
    if (defined ("AD_BLOCK") && AD_BLOCK == 3) {
    ?>
    AD CODE 3
    <?php
    }
    ?>
    Thread Starter Angel Costa

    (@angelcosta)

    Thank you!

    Plugin Author Spacetime

    (@spacetime)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Rotate between different ad block types’ is closed to new replies.