I've got a page template called tpl-memos.php which is attached to a page called 'Memos' with a parent page called 'About', the permalink for the page therefor is example.com/about/memos. On this page a custom post type called 'info' is listing its posts, and this custom post type has a rewrite of '/about/memos' – the same as the page structure.
This is working pretty good: the posts from the CPT is listed and they get the correct URL, example.com/about/memos/%post_name% and of course it's a single-info.php file that is used to output the posts.
My only problem is that I can't seem to get the pagination correct, when clicking 'Previous posts' all I get is a 404 error.
Here's some code from tpl-memos.php, nothing special:
<?php query_posts(array('post_type' => 'info', 'posts_per_page' => 10, 'paged' => $paged)); if (have_posts()): while (have_posts()): the_post(); // Some content endwhile; ?> <div class="navigation"> <span class="alignright"><?php previous_posts_link(); ?></span> <span class="alignleft"><?php next_posts_link(); ?></span> </div> <?php endif; ?>