0
我目前使用wordpress创建我的网站。我真的发现有关分页的问题。所以,基本上就能够让你明白什么是真正的我的问题,我将发布两个代码:分页在Wordpress中无法正常工作
这是第一个代码:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink()?>"><?php the_title(); ?></a></h2>
<?php include (TEMPLATEPATH.'/inc/meta.php'); ?>
<div class="entry">
<?php
the_excerpt();
?>
</div>
<br/><br/>
<h3><a href="<?php the_permalink() ?>">Read More...</a></h3>
</div>
<?php
endwhile;
?>
<?php include (TEMPLATEPATH . '/inc/nav.php'); ?>
<?php else : ?>
<h2>Not Found</h2>
<?php endif; ?>
在这个代码行,我用的常规环路查询帖子。其实我没有修改代码。我还安装了WP-PageNavi插件。没有问题,分页工作正常。
但是当我把下面这行代码,关于定期循环。分页无法正常工作。我把这行代码放在“”,因为我只想在这个类别中显示帖子。
第二码:
的代码的代码
<?php query_posts('cat=8'); ?>
结束行线
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<?php include (TEMPLATEPATH . '/inc/meta.php'); ?>
<div class="entry">
<?php the_excerpt(); ?>
</div>
<br/><br/>
<h3><a href="<?php the_permalink() ?>">Read More...</a></h3>
</div>
<?php endwhile; ?>
<?php include (TEMPLATEPATH . '/inc/nav.php'); ?>
<?php else : ?>
<h2>Not Found</h2>
<?php endif; ?>
我的问题是:我应该为分页做才能正常工作?我真的需要一些帮助。
感谢先生。它的作品 – Vhal
欢迎,如果它的作品接受答案;):D –