索引中有以下循环。php文件:
$paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$post_per_page = 30;
$do_not_show_stickies = 1;
$args=array(
\'post_type\' => array (\'portfolio\'),
\'order\' => \'DESC\',
\'paged\' => $paged,
\'posts_per_page\' => $post_per_page,
\'ignore_sticky_posts\' => $do_not_show_stickies
);
$wp_query = new WP_Query($args);
if( have_posts() ) :
while ($wp_query->have_posts()) : $wp_query->the_post();
//Do some stuff...
它工作得很好。它显示30篇文章,但如何访问第二页?
我试过了:
http://example.com/?paged=2 (服务器404错误)
http://example.com/page/2 (重定向到主页并删除/page/2
零件)
<?php wp_link_pages(); ?>
(不返回任何内容)
我有默认的永久链接。我做错了什么?如何访问帖子的第二页?