Hi all,
I've tried many different ways to get pagination working on my custom post archives to no avail. Can anyone help please? Here's where I'm at:
Post type is called 'Projects' and has the slug amended to videos:
function projects_post_type() {
register_post_type('projects', array(
'labels' => array(
'name' => 'Projects',
etc.
),
'has_archive' => true,
etc.
),
'rewrite' => array(
'slug' => 'videos'
),
etc.
I have created a specific archive-projects.pho with the following loop:
<?php query_posts( 'post_type=projects&showposts=8&paged='.$paged );
if (have_posts()) : while (have_posts()) : the_post(); ?>
post code etc.
<?php endwhile; ?>
</div>
<div id="nav-below" class="navigation">
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'vimeodrome' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'vimeodrome' ) ); ?></div>
</div><!-- #nav-below -->
<?php endif; ?>
The first page of the archive displays ok but when I click 'older posts' I get a 404 error on .../videos/page/2
I've treid resetting my permalinks (which are currently set top custom > /%postname%/) but it still won't work. All tutorials I've found state the code I've used above should work, so what am I doing wrong?