Possible Duplicate:
Pagination not working with custom loop
So I have a post type called portfolio, but I can't get it to paginate. I'd also like it to paginate on single pages so each item has a prev/next link at the bottom, but this won't work either.
I try adding this on the single page and the links just don't appear.
I've been banging my head against a brick wall for days now trying to find a solution for this and nowhere online can I find one.
<div class="next-posts"><?php next_posts_link('Older Posts') ?></div>
<div class="prev-posts"><?php previous_posts_link('Newer Posts') ?></div>
<?php
$portfolio_query = new WP_Query(array(
'post_type' => 'portfolio',
'showposts' => -1
) );
?>
<?php while ($portfolio_query->have_posts()) : $portfolio_query->the_post(); ?>
<?php global $more; $more = 0; ?>
<div class="portthumbwrap">
<a href="<?php the_permalink() ?>">
<div class="portmetacontainer">
<div class="link-text">
<h2><?php the_title(); ?></h2>
<ul>
<?php
$posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
echo '<li>' .$tag->name. '</li>';
}
}
?>
</ul>
</div> <!-- end div link-text -->
</div> <!-- end div postmetacontainer -->
</a>
<div class="figure">
<?php the_post_thumbnail(); ?>
</div>
</div> <!-- end div portthumbwrap -->
<div class="clearfix"></div>
<?php endwhile; wp_reset_query(); ?>
next_post_link
, note that it's singular post, not plural posts.