Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134292

cerics on "Adding pagination to a custom theme"

$
0
0

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 all articles
Browse latest Browse all 134292

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>