2011-02-17 3 views
0
<?php 
/* 
Template Name: Projects 
*/ 
?> 

<?php get_header();?> 

    <section id="content"> 
     <section id="main"> 

      <?php 
       $loop = new WP_Query(array('post_type' => 'projects', 'posts_per_page' => 4)); 
       $i=1; 
       while ($loop->have_posts()) : $loop->the_post(); 
      ?> 

      <article class="post<?php if($i%2 == 0) { echo ' right'; }; $i++; ?>" id="post-<?php the_ID(); ?>"> 
       <h2><?php the_title(); ?></h2> 
       <section class="entry"> 
        <?php the_excerpt(); ?> 
       </section> 
      </article> 

      <?php 
       endwhile; 
       wp_pagenavi(); 
      ?> 

      <section id="map"> 
       <img src="<?php bloginfo('template_url') ?>/images/interactive-map.jpg" alt="Interactive Map" /> 
      </section> 
     </section> 

<?php get_sidebar(); ?> 

    </section> 

<?php get_footer(); ?> 

나는 잠시 후 pagenavi를 설정했다. 그래도 작동하지 않습니다. 그것은 심지어 출처에 나타나지 않습니다. 아무도 내가이 일을 어떻게 할 수 있는지 아니?커스텀 루프로 작업하기 위해 pagenavi를 얻는 것

답변

1

동일한 문제가있었습니다. posts_per_page 매개 변수를 제거하면 pagenavi가 작동합니다. 설정> 읽기를 통해 페이지 당 게시물을 관리해야합니다. 다른 해결 방법을 찾지 못했습니다.

관련 문제