php - Create Random image slideshow -


i have website live @ moment , images desplay in sequence want add little dynamics slider , make randomly displays images instead basic code:

    <div class="container slideshowcontainer" style="width: 100%;">         <!-- begin revolution slider -->             <div class="fullwidthbanner-container slider-main margin-bottom-10">             <div class="fullwidthabnner">                 <ul id="revolutionul" style="display:none;">                                                                                                            <!-- output slides -->                     <?php                         foreach($slides $d){                     ?>                          <li data-transition="fade" data-slotamount="8" data-masterspeed="700" data-delay="9400" data-thumb="assets/img/sliders/revolution/thumbs/thumb2.jpg">                                         <?php if($d['slideshow_image_sub_title_4'] != ""){ ?>                                 <a href="<?php echo $d['slideshow_image_sub_title_4']; ?>">                                     <img src="uploads/images/<?php echo $d['slideshow_image_file']; ?>" title="<?php echo $d['slideshow_image_title']; ?>" style="width: 100%;" />                                 </a>                                                             <?php } else { ?>                                     <img src="uploads/images/<?php echo $d['slideshow_image_file']; ?>" title="<?php echo $d['slideshow_image_title']; ?>" style="width: 100%;" />                             <?php } ?>                         </li>                         <?php                         }                     ?>                                       </ul>                 <div class="tp-bannertimer tp-bottom"></div>             </div>         </div>         <!-- end revolution slider -->     </div>     

how can modify randomly display images please ask if need provide more info

thanks in advance

try this:

div class="container slideshowcontainer" style="width: 100%;">     <!-- begin revolution slider -->         <div class="fullwidthbanner-container slider-main margin-bottom-10">         <div class="fullwidthabnner">             <ul id="revolutionul" style="display:none;">                                                                                                        <!-- output slides -->                 <?php                     shuffle($slides);                     foreach($slides $d){                 ?>                      <li data-transition="fade" data-slotamount="8" data-masterspeed="700" data-delay="9400" data-thumb="assets/img/sliders/revolution/thumbs/thumb2.jpg">                                     <?php if($d['slideshow_image_sub_title_4'] != ""){ ?>                             <a href="<?php echo $d['slideshow_image_sub_title_4']; ?>">                                 <img src="uploads/images/<?php echo $d['slideshow_image_file']; ?>" title="<?php echo $d['slideshow_image_title']; ?>" style="width: 100%;" />                             </a>                                                         <?php } else { ?>                                 <img src="uploads/images/<?php echo $d['slideshow_image_file']; ?>" title="<?php echo $d['slideshow_image_title']; ?>" style="width: 100%;" />                         <?php } ?>                     </li>                     <?php                     }                 ?>                                   </ul>             <div class="tp-bannertimer tp-bottom"></div>         </div>     </div>     <!-- end revolution slider --> </div>     

http://php.net/manual/de/function.shuffle.php


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -