对于登录用户,分页工作正常。但对于未登录的用户,它显示分页但不起作用。当您单击第2页时,它会显示
“抱歉找不到帖子”
以下是link
使用的主题是ultimatum theme
以下是代码
$query = array(
'posts_per_page' => (int) $count,
'post_type' => $post,
'orderby' => $orderby,
'order' => $order,
);
if(isset($instance['pagination']) && $instance['pagination']!='false'){
$pagged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$query['paged'] = $pagged;
}
$r = new WP_Query( $query );
if ( $r->have_posts() ):
while ( $r->have_posts() ) : $r->the_post();
/// Some code here
endwhile;
if(isset($instance['pagination']) && $instance['pagination']!='false'){
echo '<div style="clear:both"></div>';
ult_custom_numeric_posts_nav($r->max_num_pages,$pagged);
echo '<div style="clear:both"></div>';
}
endif;