Need pagination to Category page
-
Yo!
I really need pagination to this piece of code.
The whole thing has to be in the loop, right?Never seen this kind of php code
<div class="newslist"> <!--Display only the latest 3 posts--> <?php $loopcounter=0; ?> <?php while (have_posts()) : the_post(); $loopcounter++; ?> <?php if ($loopcounter < 4 ) { ?> <div class="new"> <div class="catphoto"><?php the_post_thumbnail(); ?></div> <div class="catdecription"> <?php $categories = get_the_category(); $cat_name = $categories[0]->cat_name; ?> <?php if ($cat_name=='THE LATEST NEWS') { ?> <div class="cattitle"><a class="linktitle" href="<?php the_permalink() ?>" rel="bookmark" title=" <?php the_title(); ?>"><?php the_time('Y-m-d') ?> <?php the_title(); ?></a></div> <?php } ?> <!--Show only the first 100words of the post, and link it to the whole post--> <div class="catcontent"> <?php if(preg_match('/<!--more-->/', $post->post_content)) : ?> <?php the_content(); ?> <?php else : ?> <a href="<?php the_permalink(); ?>"> <?php the_content_rss('', TRUE, '', 100); ?> </a> <?php endif; ?> </div> </div> <div class="clearfix"></div> </div> <?php } ?> <?php endwhile; ?> </div>
- The topic ‘Need pagination to Category page’ is closed to new replies.