I have a problem with pagination on search results page. The page links appear, but when i click onto page 2, it gives me a 404 error.
Page 1 : http://templategraphy.com/wp-demo/businessguru/?s=Blog+Image (page 1)
Page 2 : http://templategraphy.com/wp-demo/businessguru/page/2/?s=Blog+Image (Page not found)
search.php
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array( 'paged' => $paged );
$the_query= new WP_Query($args);
?>
<div>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('item'); ?>>
<?php
$featuredImage = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
if ( has_post_thumbnail() ) {
echo '<a class="single-image link-icon" href="'.get_the_permalink().'">';
echo '<img src="'.$featuredImage.'" style="width:213px; height:110px;" />';
echo '</a>';
}
?>
</div>
<?php endwhile; ?>
<?php
next_posts_link( 'Older Entries', $the_query->max_num_pages );
previous_posts_link( 'Newer Entries' );
?>
<?php
// clean up after our query
wp_reset_postdata();
?>
</div>
<?php else : ?>
<h1 class="title">Not Found</h1>
<p>Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>
</div>
Please suggest some solutions.