我试图在我的category.php页面上添加分页并设置每页的帖子
我该如何解决这个问题 这里需要设置每页帖子和分页
这是我的category.php
的代码谢谢
<?php if( have_posts() ): ?>
<div class="cat-bread-cumb overflow-fix">
<u>
<li><a href="<?php echo site_url(); ?>"><i class="fa fa-home" aria-hidden="true"></i></a></li>
<li><span>/</span><?php the_archive_title(); ?></li>
</u>
</div>
<?php while( have_posts() ): the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( sprintf('<h1 class="entry-title"><a href="%s">', esc_url( get_permalink() ) ),'</a></h1>' ); ?>
<small>Posted on: <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>, in <?php the_category(); ?></small>
</header>
<div class="row">
<?php if( has_post_thumbnail() ): ?>
<div class="col-xs-12 col-sm-4">
<div class="thumbnail"><?php the_post_thumbnail('medium'); ?></div>
</div>
<div class="col-xs-12 col-sm-8">
<?php the_content(); ?>
</div>
<?php else: ?>
<div class="col-xs-12">
<?php the_content(); ?>
</div>
<?php endif; ?>
</div>
</article>
<?php endwhile; ?>
<?php endif; ?>