Category Loop: how do I specify # of posts per page?
-
It seems like I could just use a post query but that screws up everything. I’m using a category loop (in the loop.category.php) file and this is the code in that file:
<?php $i=0;?> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <?php $i++;?> <?php if($i%4==0){ $class='none';} else $class='';?> <li class="<?php echo $class;?>"><a href="<?php the_permalink();?>"> <?php if (has_post_thumbnail( $post->ID )) : ?> <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?> <img src="<?php echo $image[0]; ?>" width="130" height="131" alt="" /> <?php endif;?></a> <span><a href="<?php the_permalink();?>"><?php the_title();?></a></span> </li> <?php endwhile;?>
I didn’t write this, it was built into the theme someone else had edited. I’m not sure how to modify it to make 20 posts show per page with pagination at the bottom. Well, I have gotten 20 posts on the page, but not without screwing up everything else. Thoughts?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Category Loop: how do I specify # of posts per page?’ is closed to new replies.