$paged for pagination是awlays返回1,因此无论我单击哪个页面,“1”总是突出显示,并且总是显示相同的帖子。我尝试了一百万种不同的东西组合来修复,但没有任何效果:(
<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();
?>