• Resolved mnzhc

    (@mnzhc)


    there’s a way to rotate banner automatically?
    eg selecting 10 banners it selects the banners and then creates a slider rotating automatically?

    ?? Grazie e complimenti per il tuo lavoro..

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mnzhc

    (@mnzhc)

    I found a way to rotate banners..
    just create a shortcode (or php function) containing more than 1 banner and use a wrapper with an ID:

    <div id="rotator">
    [wp_bannerize_pro orderby="random" categories="header" numbers="3"]
    </div>

    then add this code somewhere (maybe inside footer):

    <script>
    var slideIndex = 0;
    showSlides();
    function showSlides() {
        var i;
        var slides = document.getElementById('rotator').getElementsByClassName('wp_bannerize_banner_box');
        for (i = 0; i < slides.length; i++) {
           slides[i].style.display = "none";  
        }
        slideIndex++;
        if (slideIndex > slides.length) {slideIndex = 1}    
        slides[slideIndex-1].style.display = "block";  
        setTimeout(showSlides, 15000); // Change image every 15 seconds
    }
    </script>
    

    and CSS (maybe header):

    <style>
    #rotator .wp_bannerize_banner_box {display:none}
    </style>

    thanks to https://www.w3schools.com/howto/howto_js_slideshow.asp
    ————

    Maybe add two parameters that allow you to add custom IDS or custom classes to the shortcodes could be useful to manage multiple instances of WP_Bannerize

    • This reply was modified 7 years ago by mnzhc.
    Plugin Author gfazioli

    (@gfazioli)

    @mnzhc interesting! The only thing that I should check is the impressions counts. I have to check that when a banner is “display none”, the impressions shouldn’t start… I will check asap

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘rotating banner’ is closed to new replies.