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與自定義循環一起工作