Hi I have created my index.php file as a blog template and on my website I am creating a page using that template.The problem is that by doing it this way pagination is not working anymore.It worked when index.php was my home page.This is my code:
$index_query = new WP_Query(array(
'posts_per_page'=>'3',
'post_type'=>'post'
));
if($index_query->have_posts()): while($index_query->have_posts()): $index_query->the_post();?>
<div>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<h3><span>Posted on <span> <?php echo get_the_date(); ?> in <?php the_category(); ?> by <?php the_author_link(); ?></h3>
<a href="<?php the_permalink(); ?>" class="box">
<?php
if(function_exists('has_post_thumbnail') && has_post_thumbnail()){
the_post_thumbnail();
}
?>
<span><?php comments_number("0") ?></span>
</a>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>" class="read">Continue Reading</a>
</div>
<?php endwhile; endif;?>
global $wp_query;
$total_pages = $wp_query->max_num_pages;
if($total_pages > 1){
$current_page = max(1 , get_query_var('paged'));
echo paginate_links(array(
'base' => get_pagenum_link(1) . '%_%',
'format' => '/page/%#%',
'current' => $current_page,
'total' => $total_pages
));
}
How can I make pagination work on page templates?

query_posts()instead ofWP_Queryand pass the paged parameter too. – Joshua Abenazer Aug 24 '12 at 8:48