Pagination in category
-
I have 50 categories in a WordPress site. I wants to show five categories on every page with pagination with 10 post. I have tried but pagination is not creating.
<?php
// get all the categories from the database
$cats = get_categories();
// loop through the categries
foreach ($cats as $cat) {
// setup the cateogory ID
$cat_id= $cat->term_id;
// Make a header for the cateogry
?>
<div class="cats-by-2">
<div class="cat-posts-left">
<h2 class="feat-title"><span><?php echo '<h2>'.$cat->name.'</h2>'; ?></span></h2>
<div class="posts-by-3">
<?php
// create a custom wordpress query
query_posts("cat=$cat_id");
$count = 1;if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post-wrap<?php if ($count%3 == 0) { ?> right<?php } ?>">
<div <?php post_class(); ?> id="post-main-<?php the_ID(); ?>">
<div class="entry clearfix">
<h2 class="post-title">" rel="<?php _e("bookmark", "solostream"); ?>" title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?>"><?php the_title(); ?></h2>
</div>
<?php include (TEMPLATEPATH . "/postinfo.php"); ?>
</div>
</div>
<?php if ( $count%3 == 0 ) { ?>
<div class="post-clear"></div>
<?php } ?><?php $count = $count + 1 ?>
<?php endwhile; endif;
// done our wordpress loop. Will start again for each category ?></div></div>
</div>
<?php } // done the foreach statement ?>The blog I need help with is: (visible only to logged in users)
-
It appears you have been answered here:
https://en.forums.wordpress.com/topic/pagination-in-category-1?replies=2
- The topic ‘Pagination in category’ is closed to new replies.