0

我刚刚将我的客户站点启动到一个临时 URL,这样他们就可以在我完成 CSS 和最后润色时进行数据输入。然而,当我启动该网站时,我发现它的一部分坏了,罪魁祸首是自定义帖子滑块。我不明白为什么它会中断,因为它在我的本地主机上运行良好。

我正在使用一个名为 Flickity 的 pkg,到目前为止,它一直对我很好。我在我的网站上使用其他 Flickity 滑块,所以我知道 Flickity 本身不是问题。我在我的滑块代码下方附上了。

自定义帖子是剧院制作,应根据结束演出日期订购:ending_date [ACF]。

<section class="slider-prod">

我们的作品

<div class="gallery js-flickity prod-slider" data-flickity-options='{"imagesLoaded": true, "selectedAttraction": 0.01, "friction": 0.3, "groupCells": 3, "cellAlign": "left", "contain": true, "pageDots": false }'>


<!-- CURRENT PRODUCTION -->       
    <?php // query posts
      $params = array(
        'post_type' => 'productions',
        'post' => $id,
        'posts_per_page' => -1,
        'meta_key' => 'ending_date',
        'orderby' => 'meta_value',
        'order' => 'ASC',
      );

      $slider_posts = new WP_Query($params);
    ?>

    <?php if ( $slider_posts->have_posts() ) while ( $slider_posts->have_posts() ) : $slider_posts->the_post(); ?>          

      <?php date_default_timezone_set('America/New_York'); 
        $slider_link = get_permalink();
        $starting_date = get_field('starting_date'); 
        $ending_date = get_field('ending_date'); 
        $location = get_field('location'); 
        $prod_link = get_permalink(); 
        $todays_date = date(Ymd); 
        ?>


      <?php if (($todays_date<=$ending_date) and ($todays_date>=$starting_date)): ?>   
        <div class="gallery-cell future-prod">
          <a href="<?php echo $slider_link; ?>" class="slider-link">            
            <?php the_post_thumbnail('hero'); ?>
            <div class="content">                
              <h3>            
                <?php the_title(); ?>
              </h3>
              <p>
              <?php 
                $end = date_create_from_format('Ymd',$ending_date);
                $start = date_create_from_format('Ymd',$starting_date);
                echo "<span class='month'>" . $start->format('F') . "</span>";
                echo " ";
                echo "<span class='day'>" . $start->format('j') . "</span>";
                echo ", ";
                echo "<span class='year'>" . $start->format('Y') . "</span>";

                echo " - ";

                echo "<span class='month'>" . $end->format('F') . "</span>";
                echo " ";
                echo "<span class='day'>" . $end->format('d') . "</span>";
                echo ", ";
                echo "<span class='year'>" . $end->format('Y') . "</span>";
                echo ", $location";
               ?> 
              </p>
              <p>              
                <?php echo wp_trim_words( get_the_content(), 40, '...' ); ?>
              </p>
              <h4 class="status now-playing">
                Now Playing
              </h4>
            </div>
          </a>
        </div> <!-- /.gallery-cell.future-pro -->
      <?php endif ?>

    <?php endwhile; ?>


<!-- FUTURE PRODUCTION -->       
    <?php // query posts
      $params = array(
        'post_type' => 'productions',
        'post' => $id,
        'posts_per_page' => -1,
        'meta_key' => 'ending_date',
        'orderby' => 'meta_value',
        'order' => 'DEC',
      );

      $slider_posts = new WP_Query($params);

      $array_rev = array_reverse($slider_posts->posts);
      //reassign the reversed posts array to the $home_shows object
      $slider_posts->posts = $array_rev;
    ?>

    <?php if ( $slider_posts->have_posts() ) while ( $slider_posts->have_posts() ) : $slider_posts->the_post(); ?>          

      <?php date_default_timezone_set('America/New_York'); 
        $slider_link = get_permalink();
        $starting_date = get_field('starting_date'); 
        $ending_date = get_field('ending_date'); 
        $location = get_field('location'); 
        $prod_link = get_permalink(); 
        $todays_date = date(Ymd); 

        ?>


      <?php if (($todays_date<$ending_date) and ($todays_date<$starting_date)): ?>   
        <div class="gallery-cell future-prod">
          <a href="<?php echo $slider_link; ?>" class="slider-link">            
            <?php the_post_thumbnail('hero'); ?>

            <div class="content">                  
              <h3>            
                <?php the_title(); ?>
              </h3>
              <p>
              <?php 
                $end = date_create_from_format('Ymd',$ending_date);
                $start = date_create_from_format('Ymd',$starting_date);
                echo "<span class='month'>" . $start->format('F') . "</span>";
                echo " ";
                echo "<span class='day'>" . $start->format('j') . "</span>";
                echo ", ";
                echo "<span class='year'>" . $start->format('Y') . "</span>";

                echo " - ";

                echo "<span class='month'>" . $end->format('F') . "</span>";
                echo " ";
                echo "<span class='day'>" . $end->format('d') . "</span>";
                echo ", ";
                echo "<span class='year'>" . $end->format('Y') . "</span>";
                echo ", $location";
               ?> 
              </p>
              <p>              
                <?php echo wp_trim_words( get_the_content(), 40, '...' ); ?>
              </p>
              <h4 class="status coming-soon">
                Coming Soon
              </h4>
            </div>
          </a>
        </div> <!-- /.gallery-cell.future-pro -->
      <?php endif ?>

    <?php endwhile; ?>

<!-- PAST PRODUCTION -->       
    <?php // query posts
      $params = array(
        'post_type' => 'productions',
        'post' => $id,
        'posts_per_page' => -1,
        'meta_key' => 'ending_date',
        'orderby' => 'meta_value',
        'order' => DEC,
      );

      $slider_posts = new WP_Query($params);
    ?>

    <?php if ( $slider_posts->have_posts() ) while ( $slider_posts->have_posts() ) : $slider_posts->the_post(); ?>          

      <?php date_default_timezone_set('America/New_York'); 
        $slider_link = get_permalink();
        $starting_date = get_field('starting_date'); 
        $ending_date = get_field('ending_date'); 
        $location = get_field('location'); 
        $prod_link = get_permalink(); 
        $todays_date = date(Ymd); ?>

      <?php if ($ending_date<$todays_date): ?>   
        <div class="gallery-cell past-prod">
          <a href="<?php echo $slider_link; ?>" class="slider-link">            
            <?php the_post_thumbnail('hero'); ?>

            <div class="content">  
              <h3>            
                <?php the_title(); ?>
              </h3>
              <p>              
                <?php echo wp_trim_words( get_the_content(), 40, '...' ); ?>
              </p>
              <h4 class="status coming-soon">
                Past Production
              </h4>
            </div>
          </a>
        </div> <!-- /.gallery-cell.past-prod -->
      <?php endif ?>

    <?php endwhile; ?>


    <?php $prod_link = get_permalink(11); ?>
    <div class="gallery-cell read-more">
      <a href="<?php echo $prod_link; ?>" class="slider-news">
        <h4 class="slider-news">READ MORE</h4>
      </a>
    </div> <!-- /.gallery-cell.read-more -->
</div> <!-- /.gallery -->

在我的开发工具中检查控制台错误后,它出现了以下错误。有什么建议么?

Uncaught ReferenceError: jQuery is not defined at jquery-migrate.min.js:2 (index):87 Uncaught ReferenceError: jQuery is not defined at (index):87

4

1 回答 1

0

您应该调试您的错误,使用浏览器的开发人员工具并检查控制台错误,它将显示给您,我认为所有文件都没有正确上传,或者它们可能是您上传的文件和文件夹的权限问题您可以检查和更新权限来自filezilla或您使用的任何其他 ftp 客户端

于 2016-12-20T05:20:09.013 回答