• Resolved filipv

    (@filipv)


    Is it possible to (when inserting ads or other content) to alternate or randomise the position of the repeater template?

    What I am trying to do is insert ads at different locations on ever load more press. For example the page first loads and ad is inserted after 3rd post, then when someone loads more, its now inserted after the 1st post?

    Many thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter filipv

    (@filipv)

    This is how I am randomising content inside of the repeater template but how do I randomise the position?

    <?php
    // the array
    $arrX = array(
    "h_graphic1.png", 
    "h_graphic2.png",
    "h_graphic3.png",
    );
     
    // get random index from array $arrX
    $randIndex = array_rand($arrX);
    ?>
    
    <img src="<?php // output the value for the random index
    echo $arrX[$randIndex];
    ?>">
    Plugin Author Darren Cooney

    (@dcooney)

    Hi @filipv
    I missed this message…
    With the CTA add-on you cannot move the position the CTA is injected, unfortunately.

    Sorry for the delayed response.

    Thread Starter filipv

    (@filipv)

    @dcooney thanks. Is it possible to inject more than one item, ie in different places?

    Plugin Author Darren Cooney

    (@dcooney)

    Not currently, This is on my feature list. Hopefully soon.

    Thread Starter filipv

    (@filipv)

    @dcooney OK, great. That would (almost) solve my issue ?? Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Alternate/Randomise cta_position’ is closed to new replies.