I set up wordpress newly and add next previous pagination in home page using following code
next_posts_link('Older Entries »', 0);
previous_posts_link('« Newer Entries', 0);
Pagination URL work correct. when click previous link it go to http:www.mydomain.com/blog/page/2/ URL but content not load. IT shows same first page blog post list. I have 70 blog posts and each page show 4 post. How do I load post in pagination URL? Do I need to make any .htaccess or WP setting change?
$args = array('numberposts' => 4);
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post);
$a = get_post_custom();
$blogroll_image = $a['mainImage'];
print('
<section class="main_post bg_white fl">
<section class="post_img fl">');
print('<a href="' . get_permalink() . '"><img src="'.$blogroll_image[0].'" width="385" height="385" alt=""/></a>');
print('</section>
<section class="post_content fl col_light_blue">
<p>' . get_the_date() .' </p>');
the_title('<a href="' . get_permalink() . '"><h1 class="col_light_blue">', '</h1></a>');
print(the_excerpt('<p>', '</p>'));
print('</section>
<!-- end .main_post -->
</section>
<div class="spacer_1px"></div>');
endforeach;
next_posts_link('Older Entries »', 0);
previous_posts_link('« Newer Entries', 0);
query_postsor otherwise altering the query in your template? – Milo Oct 4 '12 at 5:41query_posts– miuranga Oct 4 '12 at 5:42query_poststo alter the main query. post the query code you are using in your template if you need help fixing it. – Milo Oct 4 '12 at 5:46