所以我需要在文章标题之前有一个页面slug Blog,我使用重写规则来实现这一点,但这样做会导致404个分页错误。下面是我用来重写的代码。
add_action( \'init\', \'my_new_default_post_type\', 1 );
function my_new_default_post_type() {
register_post_type( \'post\', array(
\'labels\' => array(
\'name_admin_bar\' => _x( \'Post\', \'add new on admin bar\' ),
),
\'public\' => true,
\'_builtin\' => false,
\'_edit_link\' => \'post.php?post=%d\',
\'capability_type\' => \'post\',
\'map_meta_cap\' => true,
\'hierarchical\' => false,
\'rewrite\' => array( \'slug\' => \'blog\' ),
\'query_var\' => false,
\'supports\' => array( \'title\', \'editor\', \'author\', \'thumbnail\', \'excerpt\', \'trackbacks\', \'custom-fields\', \'comments\', \'revisions\', \'post-formats\' ),
) );
}
这是网站URL
Blog Page“重写”对该页很有效
Single Post但不是为了Pagination 请指导我解决这个问题。