cyclone slider : add page num setting

The Cyclone slider plugin for wordpress is one of the best free plugins available for making sliders within pages and posts. Apart from dealing with slides within a drag and drop framework, it also features a list of parameters for each slider, but the possibility to use numbers in the slide pagers is currently missing. it is very easy to add, so I put the code below until a new release comes with that feature.

 Note : before using the code below make sure you upgrade cyclone slider to the latest version of jcycle2  

  • in inc / admin parts/ slider-properties, add the html code to display the input field 

    <!--webmasterbulletin.net 20130505 add pagenum settings-->
    <div class="cycloneslider-field">
    	<label for="cycloneslider_settings_randomize"><?php _e('Pager / slide num ?', 'cycloneslider'); ?></label>
    	<select id="cycloneslider_settings_slide_num" name="cycloneslider_settings[slide_num]">
    		<option <?php echo (0==$slider_settings['slide_num']) ? 'selected="selected"' : ''; ?> value="0"><?php _e('No', 'cycloneslider'); ?></option>
    		<option <?php echo (1==$slider_settings['slide_num']) ? 'selected="selected"' : ''; ?> value="1"><?php _e('Yes', 'cycloneslider'); ?></option>
    	</select>
    	<span class="note"><?php _e('display slide num in pager.', 'cycloneslider'); ?></span>
    	<div class="clear"></div>
    </div>
    <!--webmasterbulletin.net 20130505 add pagenum settings-->
  • in class-cyclone-slider, add the save value code in save_settings function
      $settings['slide_num'] = (int) ($_POST['cycloneslider_settings']['slide_num']); //webmasterbulletin.net20130505
  • and in the same file add the get setting code in  the shortcode function : 
    $slider_settings['slide_num'] = $this->get_comp_slider_setting($admin_settings['slide_num'], $shortcode_settings['slide_num']); //webmasterbulletin.net20130505
  • finally in functions.php, add the jcycle setting if the cyclone slider setting is on in cyclone_settings function

    if ($slider_settings["slide_num"])$defaults['data-cycle-pager-template']="<strong><a href=#> {{slideNum}} </a></strong>"; //webmasterbulletin.net20130505

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *