2016-12-20 15 views
0

私のカスタムポストタイプのアーカイブページにWP_queryを使用しており、クエリが無限ループに詰まっているようです。WordPressカスタムポストタイプ無限ループ


archive.php

<?php 
    $query = new WP_Query(array(
     'post_type' => 'faqs', 
     'post_status' => 'publish', 
     'posts_per_page' => -1 
    )); 
    while ($query->have_posts()) { 
     $query->the_post(); 
     $faqs_loop = get_template_part('loop-faqs'); 
    } 
    wp_reset_query(); 
?> 

loop.php

<?php if (have_posts()): while (have_posts()) : the_post(); ?> 
     <div class="accordion-section"> 
      <a class="accordion-section-title" href="#<?php the_id(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> 
      <div id="<?php the_id(); ?>" class="accordion-section-content"> 
       <?php the_content(); ?> 
      </div> 
     </div> 
<?php endwhile; ?> 
+0

無限ループとは何でしょうか? – dave

答えて

0

uがそれだけでブラウザのクラッシュにロードウェッブで無限ループを行うかprossesを停止カント

関連する問題