I have tested all my CPT’s using new archive feature on 3.1
Some have custom queries, some do not. All paginate properly
Flush your permalinks by visiting your settings->permalinks page and hitting save
(I believe just visiting the page does it, but hitting save doesn’t hurt)
See if that helps
Thread Starter
driz
(@driz)
Tried that several times and still not getting anywhere :/
I have even tried adding the following in the template archive-questions.php
to see if I can force the paging:
<?php global $query_string; query_posts( $query_string . 'orderby=date&posts_per_page=10&post_type=questions&paged=' . get_query_var( 'page' ) ); ?>
But still I get a 404 :/
Try it with this:
<?php
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page');
} else { $paged = 1; }
?>
<?php global $query_string; query_posts( $query_string . 'orderby=date&posts_per_page=10&post_type=questions&paged=' . $paged); ?>
Thread Starter
driz
(@driz)
Still get the 404 🙁 tried flushing the permalinks again after adding your code but still get a 404!
Here is archive-questions.php in full: http://pastebin.com/6ZPLz975
Do you see any problems? Thanks.
Can we see how you registered your post type (register_post_type) in functions.php.
if you have something like this in it:
'rewrite' => array( 'slug' => 'questions', 'with_front' => true ),
try and change it to:
'rewrite' => array( 'slug' => 'question', 'with_front' => true ),
and see if that helps
Try quering without the query string:
<?php
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page');
} else { $paged = 1; }
?>
<?php query_posts('orderby=date&posts_per_page=10&post_type=questions&paged=' . $paged); ?>
Thread Starter
driz
(@driz)
Here: http://pastebin.com/WZyGcju6
I’ve tried it with and without the query_posts but the pagination still does not work
Same here… No luck whatever I do.
It seems like a bug to me because I and many others cannot get this to work on a custom post type archive.