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.

i am using below code which should render next and previous post thumbnail but it is showing the current post thumbnail in Custom Post Type single page

<?php 

$prevpost = get_previous_post(true);
$prevThumbnail = get_the_post_thumbnail($prevpost->ID, array(80,80) );

next_post_link('%link', '<span>' . $prevThumbnail . '</span>%title'); 

$nextpost = get_next_post(true);
$nextThumbnail = get_the_post_thumbnail($nextpost->ID, array(80,80) );

previous_post_link('%link', '<span>' . $nextThumbnail . '</span>%title');           

?>

How to solve this?

share|improve this question
    
What Wordpress Debug Says ? –  amit Aug 5 '12 at 12:26
add comment

1 Answer

up vote 1 down vote accepted

Try without passing the true argument to get_previous_post() function, because that paramters is used to get link of previous post of same category. Possibly you've not registered the category taxonomy while registering that custom post type.

share|improve this answer
    
Exactly that was the issue.. Thanks a lot.. –  pixelngrain Aug 5 '12 at 14:00
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.