I must be annoying your with all these permalink questions :)
The code I'm using for the loop is:
// hijack stupid WP globals to get pagination working...
global $wp_query;
$temp = $wp_query;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$wp_query = new WP_Query();
$wp_query->query(array(
'post_parent' => get_the_ID(),
'post_type' => 'topic-reply',
'posts_per_page' => 10,
'order' => 'ASC',
'paged' => $paged,
));
if($wp_query):
wp_pagenavi();
while ($wp_query->have_posts()):
$wp_query->the_post();
get_template_part('topic-reply');
endwhile;
wp_pagenavi();
endif;
$wp_query = $temp;
wp_reset_query();
The pagination works fine if permalinks are set to defaults, when clicking on page 2 link the URL I get is like:
http://localhost/wp/?topic=sometopictitle&paged=2
The problem comes when I set the permalinks to a custom structure; when clicking on page 2, I get the first page URL:
http://localhost/wp3/forum/general-discussion/topic/sometopictitle/
instead of
http://localhost/wp3/forum/general-discussion/topic/sometopictitle/page/2/
(A live example here
)
Does anyone know the rules I should add to set paged permalinks for the "topic-reply" post type?