Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible to add pagination to the single.php for a Custom Post Type, such as single-items.php. On this single page, I am using the Posts 2 Posts plugin (http://wordpress.org/plugins/posts-to-posts/) to get all connected custom post types that are connected to the Item custom post type. I would like to paginate these connected posts on this single page. How would I go about doing this?

Thank you.

share|improve this question
add comment

2 Answers 2

This includes a hook for genesis however you can easily change it and the name of your portfolio slug.

function wpsites_npp_navigation_links() {
if( 'portfolio' == get_post_type() && is_single() ) {?>
<?php previous_post('&laquo; &laquo; %', 'Previous', 'no'); ?>
 | <?php next_post('% &raquo; &raquo; ', 'Next', 'no'); ?>
<?php
} }
/**
* @author Brad Dalton
* @learn more http://wp.me/p1lTu0-9YH
*/
add_action('genesis_after_post_content', 'wpsites_npp_navigation_links', 5 );
share|improve this answer
add comment

This is not an easy thing to fix, but I found one solution.

Essentially you need to turn off the canonical redirect by adding the following to your functions.php (or plugin).

function vee_disable_redirect_canonical($redirect_url) {
if (is_singular('YOUR_PAGE_SLUG')) $redirect_url = false;
return $redirect_url;
}
add_filter('redirect_canonical', 'vee_disable_redirect_canonical');

Good luck

Vee

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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