几天来,我一直在尝试如何修复wordpress网站索引的分页。分页在类别和其他归档文件上效果很好,但在我的索引上不起作用
点击页码有404。我发现链接指向domain.com?paged=4.Replacing ?paged=4 with ?page=4 the pagination work!
<?php wp_reset_query(); ?>
<?php
$paged = (get_query_var(\'page\')) ? get_query_var(\'page\') : 1;
$args = array(
\'post_type\' => array(of_get_options( \'url_movie\', \'movie\') ),
\'showposts\' => get_option(\'posts_per_page \'),
\'order\' => \'DESC\',
\'paged\' => $paged
);
query_posts($args);
while ( have_posts() ) : the_post(); ?>
<li class="item">
<a class="poster" href="<?php the_permalink(); ?>" title="<?php if(show_info(\'name\', $post->ID ) == "N/A"){echo show_info(\'title\', $post->ID ); }else{echo show_info(\'name\', $post->ID );} ?>">
<img src="<?php image_show("poster_path", $post->ID, "w185"); ?>" alt="<?php if(show_info(\'name\', $post->ID ) == "N/A"){echo show_info(\'title\', $post->ID ); }else{echo show_info(\'name\', $post->ID );} ?>" />
</a>
<div class="info">
<h3 class="name"><a href="<?php the_permalink(); ?>" title="<?php if(show_info(\'name\', $post->ID ) == "N/A"){echo show_info(\'title\', $post->ID ); }else{echo show_info(\'name\', $post->ID );} ?>"><?php if(show_info(\'name\', $post->ID ) == "N/A"){echo show_info(\'title\', $post->ID ); }else{echo show_info(\'name\', $post->ID );} ?></a></h3>
<span class="genero"><?php $category = get_the_category($post->ID); echo $category[0]->cat_name; ?></span>
</div>
</li>
<?php endwhile; ?>
</ul>
<div class="clear"></div>
<?php if(function_exists(\'wp_paginate\')) {
wp_paginate();
}
else {
pagenavi();
} ?>