2012-03-05 78 views
1

我已經調整了Supersized滑塊與WP電子商務一起使用來創建特色產品滑塊。Supersized Slider + Wp電子商務

它適用於在安裝滑塊之前歸因於特色類別的產品,但只要我將新產品添加到類別中,就會中斷。

有人可以快速看一下我的代碼,看看我能否更好地實現它,並找出它出錯的原因?對我來說這似乎不合邏輯!

可以看看我的源位置:http://thetechhunter.co.za/

var $j = jQuery.noConflict(); 

     jQuery(function($){ 
      $j.supersized({ 

       //Functionality 
       slideshow    : 1,  //Slideshow on/off 
       autoplay    : 1,  //Slideshow starts playing automatically 
       start_slide    : 1,  //Start slide (0 is random) 
       random     : 0,  //Randomize slide order (Ignores start slide) 
       slide_interval   : 10000, //Length between transitions 
       transition    : 1,  //0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left 
       transition_speed  : 500, //Speed of transition 
       new_window    : 0,  //Image links open in new window/tab 
       pause_hover    : 0,  //Pause slideshow on hover 
       keyboard_nav   : 1,  //Keyboard navigation on/off 
       performance    : 1,  //0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit) 
       image_protect   : 1,  //Disables image dragging and right click with Javascript 
       image_path    : 'img/', //Default image path 

       //Size & Position 
       min_width    : 0,  //Min width allowed (in pixels) 
       min_height    : 0,  //Min height allowed (in pixels) 
       vertical_center   : 1,  //Vertically center background 
       horizontal_center  : 1,  //Horizontally center background 
       fit_portrait   : 1,  //Portrait images will not exceed browser height 
       fit_landscape   : 0,  //Landscape images will not exceed browser width 

       //Components 
       navigation    : 1,  //Slideshow controls on/off 
       thumbnail_navigation : 1,  //Thumbnail navigation 
       slide_counter   : 1,  //Display slide numbers 
       slide_captions   : 1,  //Slide caption (Pull from "title" in slides array) 
       slides     : [  //Slideshow Images 


            <?php $my_query = new WP_Query(array('post_type' => 'wpsc-product', 'wpsc_product_category'=>'featured-products')); while($my_query->have_posts()) : $my_query->the_post();?> 

                {image : '<?php echo wpsc_the_product_image(); ?>', 
                title : '<div class="slidecaptioninside"><a href="<?php echo wpsc_the_product_permalink(); ?>"><?php echo wpsc_the_product_title(); ?></a><br /><span style="color: #111;"><?php echo wpsc_the_product_price(); ?></span></div><br /><div class="slidedescription"><?php $excerpt = wpsc_the_product_description(); echo string_limit_words($excerpt,50)."...";?></div>', 
                 url : '<?php echo wpsc_the_product_permalink(); ?>'}, 

            <?php endwhile; ?>  
              ] 

      }); 
     }); 

回答

1

您是否嘗試過這個插件安裝WP Supersized

您也可以按照以下的教程鏈接,我希望這是你需要什麼,讓我知道。

How to integrate Supersized in wordpress

在插件中,作者好像是用「功能slides_list()」,以輸出圖像陣列和移除用於最終滑動逗號。

如果你已經解決了這個問題 - 請問你的答案是否對他人好處