WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Pagination not working with custom loop

Any ideas why this paged wp_query doesn't seem to want to work?

I've tried replacing the pt_pagination function with the default next/prev posts links and that didn't work either...

<?php 
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array (
    'post_type' => 'pt-portfolio',
    'paged' => $paged,
);
$pt_portfolio_loop = new WP_Query($args);
while($pt_portfolio_loop->have_posts()) : $pt_portfolio_loop->the_post();
?>

<?php
$cols = of_get_option('pt_portfolio_layout');
get_template_part('portfolio', $cols);
?>

<?php endwhile; ?>

<?php pt_pagination(); ?>

<?php wp_reset_postdata();?>
share|improve this question

marked as duplicate by Chip Bennett, toscho Dec 21 '12 at 17:26

This question was marked as an exact duplicate of an existing question.

    
Please elaborate on doesn't seem to want to work. What do you expect to happen? What does or doesn't happen? – Rarst Dec 21 '12 at 17:25

Try to change the pt_pagination position

<?php wp_reset_postdata();?>

<?php pt_pagination(); ?>

Or you can try Pippin code https://github.com/pippinsplugins/EDD-Starter-Theme/blob/master/front-page.php#L5-L14

share|improve this answer
    
Please explain why that could solve the problem. – toscho Dec 18 '12 at 17:48
    
I imagine the wp_reset_postdata(); breaking the pagination :) – Satrya Dec 18 '12 at 17:56
    
Nope, that didn't work... – Dean Elliott Dec 18 '12 at 18:55

Are you using any custom query before you do the 'pages' stuff? If so, try to add wp_reset_query(); or wp_reset_postdata(); before this get_query_var('paged'); code.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.