1
我已經從這個位置下載了wp-pagenavi。 http://wordpress.org/extend/plugins/wp-pagenavi/installation/
。我使用的是wordpress 3.3.1。我已經使用說明安裝了這個插件。我在home.php中使用了以下代碼來顯示帖子和分頁。wp-pagenavi插件中的bug
<?php
/**
* Template Name: Home Page
*/
get_header();
?>
<?php include(TEMPLATEPATH."/sidebar.php");?>
<div id="content_right">
<?php if (function_exists('yoast_breadcrumb')) {
yoast_breadcrumb('<div id="breadcrumbs">','</div>');
} ?>
<div class="clear"> </div>
<?php
// Display most recent posts
$the_query = new WP_Query("showposts=5");
$postcount = 0;
while ($the_query->have_posts()) : $the_query->the_post();
$postcount++;
?>
<div class="blog_left">
<div><?php
if (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
}
?>
</div>
</div>
<div class="blog_right">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<div>in: <?php the_category(', ') ?></div>
<?php the_excerpt(); ?>
</div>
<div class="clear"></div>
<?php
if($postcount != 5){?>
<p class="blogdivider"></p>
<?php } ?>
<?php endwhile;
$count = 0;
?>
<?php wp_pagenavi(); ?>
</div>
<?php get_footer(); ?>
但是分頁不會顯示在我的網頁中。我無法追蹤遺失的東西。有什麼建議麼?
發佈的複製和粘貼樣板/逐字回答多個問題時一定要小心,這些往往被標記作爲社區的「垃圾」。如果你這樣做,那麼它通常意味着問題是重複的,因此將它們標記爲:http://stackoverflow.com/questions/9518478/wp-pagenavi-not-working-solution/9571088#9571088 – Kev 2012-03-05 23:47:34