I'm working with custom post type, that I want to paginate, here's part of code, initializing custom post type:
$args = array( 'labels' => $labels, 'public' => false, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title', 'page-attributes') ); register_post_type( 'article', $args );
So, when url is
/article I see first page of posts and there's no problem.
paginate_links() function creates link to the second page
/article/page/2, but it doesn't work - I have 404 error. This topic describes absolutely the same problem, but solution by Mark doesn't work for me. If I add
'rewrite' => array( 'slug' => 'artone') for example, url
/article doesn't work at all, only
As I understand, method of printing my articles doesn't matter. When I search something about this problem, I can see only advices about
WP_query and so on. But
is_archive() becomes false and
is_404() becomes true even before
header.php, so I don't know, where the problem can be, maybe something in
Also, even if I set default permalinks
/?paged=2&post_type=article doesn't work!
P.S. I don't forget flushing rewrite rules