I have the following custom query and im attempting to paginate the links of previous archive posts using the example from the wordpress codex
http://codex.wordpress.org/Function_Reference/paginate_links#Basic_Example
Am i inserting this in the wrong place? I inserted before the end of the query with the basic arguments, and there is just a place space at the moment.
Any advice / tutorial is appreciated.
Update 2: Ive now tried the change in the wp_query in the pagination piece, and still no luck.
<div id = "innerpagemaincontent">
<h2 class="innerpagetitle">Latest News</h2>
<div class="r-post clearfix">
<?php // custom loop query
$carouselPosts = new WP_Query('showposts=5');
// Pagination fix
$original_query = $wp_query;
$wp_query = NULL;
$wp_query = $carouselPosts;
// open loop
if ( $carouselPosts ->have_posts() ) : while ( $carouselPosts->have_posts() ) : $carouselPosts->the_post(); ?>
<div class="otherrecentpostswrap">
<div id="postdetails"><div class="boldyfont">Posted by <?php the_author(); ?><br/><?php the_category(','); ?></div><a href="<?php the_permalink(); ?>"><?php the_date (); ?></a></div>
<div class="thumb"><a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(array(160,160)); ?><span class="overlay"> </span></a></div>
<div id="postewrapper">
<div class="recentpostscontent">
<a href="<?php the_permalink(); ?>">
<span class="innerpageposttitle"><?php the_title(); ?></a></span>
<?php the_excerpt(); ?>
<br/>
<br/>
<a class="readmorelink" href="<?php the_permalink(); ?>"> Read More </a> </div></div>
<br/><br/>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $carouselPosts->max_num_pages
) ); ?>
<?php wp_reset_query(); ?>