0

$paged for pagination is awlays returning 1, so no matter what page i click "1" is always highlighted and it always shows the same posts. i have tried a million different combinations of things to fix and nothing works :(

<ul>
     <?php 



        wp_reset_query();

        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
echo $paged;
        $mixtapes = new WP_Query ( array
          ( 'post_type' => 'mixtapes', 'posts_per_page' => 4, 'paged'=>$paged ) 
        );


        while ($mixtapes->have_posts()) : $mixtapes->the_post();

          $img_id = get_post_meta($post->ID,'image',true);
          $img_url = wp_get_attachment_url($img_id);
          ?>

         <li>
          <a href="<?php the_permalink(); ?>"><img class="cover" src="<?php echo get_bloginfo('url').'/timthumb.php?src='.str_replace("http://freshnewmixtapes.net","",$img_url).'&q=100&h=176&w=176'; ?>" alt="<?php the_title(); ?>" />
</a>
          <h3><?php echo the_title(); ?></h3>

          <a href="<?php the_permalink(); ?>" class="download">Download</a>
          <a href="<?php the_permalink(); ?>" class="play">Play</a>

         </li>

        <?php 
        endwhile;?>
       <?php ?>
</ul>

<br style="clear:both;">
<?php wp_pagenavi( array( 'query' => $mixtapes ) );
wp_reset_postdata();
?>

1 Answer 1

1

See Pagination Parameters under WP_Query in Codex:

Since Wordpress 3.0.2, you do get_query_var( 'page' ) instead of get_query_var( 'paged' ). The pagination parameter 'paged' for WP_Query() remains the same.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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