0

The same old problem and not sure if its even possible.

Pagination on a single.php custom post type, is it possible?

This works fine until i turn permalinks to /%postname%/ then it just reloads the same page when click on the previous/next links,

<?php 
  $temp = $wp_query; 
  $wp_query = null; 
  $wp_query = new WP_Query(); 
  $wp_query->query('showposts=1&orderby&menu_order&post_type=press-round'.'&paged='.$paged); 

  while ($wp_query->have_posts()) : $wp_query->the_post(); 
?>


  <?php the_title(); ?>

<?php endwhile; ?>

<nav>
<?php previous_posts_link('&laquo; Newer') ?>
<?php next_posts_link('Older &raquo;') ?>
</nav>

<?php $wp_query = null;  $wp_query = $temp;?>

I've refreshed the permalinks, removed the htaccess, made sure a page is not the same name everything that you'd usually do.

Is it just not possible to have permalinks on for pagination on a single custom post type page?

1

1 Answer 1

1

The problem is you're using next_posts_link() etc... note the plural form 'posts'.

To link to previous and next single posts you need to use next_post_link() and previous_post_link().

Basically change 'posts' to 'post' in the function names.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.