我正在使用此代码在我的网站上显示页面分页。但当我单击转到第二个页面时,它会显示“未找到页面”错误。
有人知道我的代码没有在第二页显示帖子有什么问题吗?
<?php
$currCat = get_category(get_query_var(\'cat\'));
$cat_name = $currCat->name;
$cat_id = get_cat_ID( $cat_name );
?>
<?php
$paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$wp_query-
>query(\'showposts=3&post_type=post&paged=\'.$paged.\'&cat=\'.$cat_id);
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
<div class="module-container">;
<div class="content">;
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title();
?></a>
</div>
</div>
<?php endwhile; ?>
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo \'<div class="paginate-links">\';
echo paginate_links( array(
\'base\' => str_replace( $big, \'%#%\', esc_url( get_pagenum_link( $big )
) ),
\'format\' => \'?paged=%#%\',
\'prev_text\' => __(\'<<\'),
\'next_text\' => __(\'>>\'),
\'current\' => max( 1, get_query_var(\'paged\') ),
\'total\' => $wp_query->max_num_pages
) );
echo \'</div>\';
?>