2013-05-01 55 views
1

我使用的是wordpress主題,Pitch Pro,它有一個內置滑塊。我的問題是,有時滑塊會一秒鐘閃爍錯誤的圖像。我注意到它通常不會這樣做,但只有當我從一個頁面(如支持頁面)進入頁面。我試過更改並設置順序。改變幻燈片的最大數量,目前爲6,但似乎沒有解決它。圖像滑塊首先閃爍錯誤圖像

該網站目前是jrummy16.com/test如果任何人有任何想法的修復。

不知道這是否可能與它有關,但我使用的服務器有問題並修復它hostgator告訴我添加define('CONCATENATE_SCRIPTS',false);到我的config.php文件。它解決了這個問題,但在添加之前我不記得有這個問題的滑塊。

我不知道如何開始排除故障。所以任何幫助將不勝感激。

編輯 所有的文件都在Theme,Pitch Pro中找到。

我打開了我的home.php文件,我發現這在頂部的滑塊。

<?php 
    $slider_template = apply_filters('pitch_slider_template', array('slider', null)); 
    get_template_part($slider_template[0], $slider_template[1]); 
?> 

然後我去了並打開同一個文件夾中的slider.php。它有這個代碼,

<?php 

$slides = new WP_Query(array(
    'numberposts' => siteorigin_setting('slider_max_slides'), 
    'nopaging'  => true, 
    'post_type' => 'slide', 
    'orderby' => 'menu_order', 
    'order' => 'ASC' 
)); 

if($slides->have_posts()){ 
    ?> 
    <div id="slider"> 
     <div class="container"> 
      <div class="slides nivoSlider"> 
       <?php while ($slides->have_posts()) : $slides->the_post(); if(has_post_thumbnail()) : ?> 

        <?php if(get_post_meta(get_the_ID(), 'slide_destination', true)) : $destination = get_post_meta(get_the_ID(), 'slide_destination', true) ?> 
         <?php echo '<a href="'.esc_url(get_permalink($destination)).'" title="'.esc_attr(get_the_title($destination)).'">' ?> 
        <?php elseif(get_post_meta(get_the_ID(), 'slide_destination_url', true)) : $destination = get_post_meta(get_the_ID(), 'slide_destination_url', true) ?> 
         <?php echo '<a href="'.esc_url($destination).'">' ?> 
        <?php endif; ?> 
        <?php echo get_the_post_thumbnail(get_the_ID(), 'slide') ?> 
        <?php if(!empty($destination)) echo '</a>' ?> 
       <?php endif; endwhile; ?> 
      </div> 

      <?php $slides->rewind_posts(); ?> 

      <div class="indicators-wrapper"> 
       <ul class="indicators"> 
        <?php while ($slides->have_posts()) : $slides->the_post(); if(has_post_thumbnail()) : ?> 
        <li class="indicator <?php if($slides->current_post == 0) echo 'active' ?> indicator-group-<?php echo $slides->post_count ?>"> 
         <div class="indicator-container"> 
          <div class="pointer"></div> 
          <h4><?php the_title() ?></h4> 
          <?php the_excerpt() ?> 
         </div> 
        </li> 
        <?php endif; endwhile; ?> 
       </ul> 
      </div> 
     </div> 
    </div> 
    <?php 
    wp_reset_postdata(); 
} 

我不確定這是否會有所幫助,但我希望它可以。

回答

1

我想原因是,前滑蓋的負荷完全,頁面會在幻燈片的列表,並在你的情況顯示最後一個圖像是這一個:

<img width="705" height="344" src="http://jrummy16.com/test/wp-content/uploads/BA-slider.jpg" class="attachment-slide wp-post-image" alt="BA-slider"> 

這裏是一個similar problem,它有幾個你也可以使用它的解決方案。

UPDATE:

我發現這個article這表明修改CSS。我會在這裏粘貼代碼,但文章使用圖像來顯示CSS代碼:)

+0

謝謝,但該鏈接並沒有幫助。我用滑塊的代碼更新了我的第一篇文章。 – 2013-05-01 15:50:14

+0

我不認爲問題在於PHP,而是使用jQuery/CSS。我更新了答案。也許這個鏈接會幫助你。 – user850010 2013-05-01 16:09:20

+0

這表示感謝! – 2013-05-01 16:35:53