Knowledgebase

Main Homepage Slider Auto-Rotate – Bloggit WordPress theme

By default the main homepage slider in the Bloggit WordPress theme does not auto-rotate, however you can easily edit your javascript to make it rotate.

  1. Make sure you are working locally because you can’t edit js files via the WordPress editor.
  2. Open js/royalslider-home-init.js
  3. Add the following to the default function
    autoPlay: {
    enabled: true,
    pauseOnHover: true
    },
    
  4. So the whole thing would look like this
    jQuery(function($){
    $(document).ready(function(){
    $('#video-gallery').css('display', 'block').royalSlider({
    autoPlay: {
    // Code Added starts
    enabled: true,
    pauseOnHover: true
    },
    // Code Added ends
    sliderDrag: false,
    navigateByClick: false,
    arrowsNav: false,
    fadeinLoadedSlide: true,
    controlNavigationSpacing: 0,
    controlNavigation: 'thumbnails',
    thumbs: {
    autoCenter: false,
    fitInViewport: true,
    orientation: 'vertical',
    spacing: 0,
    paddingBottom: 0
    },
    keyboardNavEnabled: true,
    imageScaleMode: 'fill',
    imageAlignCenter:true,
    loop: false,
    loopRewind: true,
    numImagesToPreload: 3,
    video: {
    autoHideArrows:true,
    autoHideControlNav:false,
    autoHideBlocks: true
    },
    autoScaleSlider: true,
    autoScaleSliderWidth: 920,
    autoScaleSliderHeight: 450
    });
    });
    });
    
  5. Save and replace with your live version of the file
  6. Clear your browser cache and refresh your site