Adding pagination to a custom theme
-
I’ve built a custom theme and I would like to add pagination to it.
In my search.php file I have this loop set up:
<?php $search_count = 0; $search = new WP_Query("s=$s & showposts=-1"); if($search->have_posts()) : while($search->have_posts()) : $search->the_post(); $search_count++; endwhile; endif; echo $search_count;?> results for '<?php the_search_query(); ?>' </h4> <ol class="search-result"> <?php if(have_posts()) : while(have_posts()) : the_post(); ?> <li> <a href="<?php the_permalink(); ?>"><span class="the-title"><?php the_title(); ?></span> <span class="the-exerpt"><?php the_excerpt(); ?></span> <span class="the-permalink"><?php the_permalink(); ?></span></a> </li> <?php endwhile; endif; ?>
How can I add pagination to this?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Adding pagination to a custom theme’ is closed to new replies.