Created
March 14, 2015 05:15
-
-
Save projoomexperts/e63152d5d8f3264f5a47 to your computer and use it in GitHub Desktop.
Woocommerce next previous product with image thumbnail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="next-prev-page"> | |
<span class="inner"> | |
<?php | |
$prevPost = get_previous_post(); | |
$prevThumbnail = get_the_post_thumbnail($prevPost->ID, array(150,150) ); | |
$prevLink = get_permalink( $prevPost->ID ); | |
?> | |
<?php if($prevPost){ ?> | |
<a class="prev" href="<?php echo $prevLink; ?>"> | |
<?php print_r($prevThumbnail);?> | |
<i class="icon-arrow4-left"></i> | |
</a> | |
<?php } ?> | |
<?php | |
$nextPost = get_next_post(); | |
$nextLink = get_permalink( $nextPost->ID ); | |
?> | |
<?php if($nextPost) { ?> | |
<a class="next" href="<?php echo $nextLink; ?>"> | |
<i class="icon-arrow4-right"></i> | |
<?php | |
$nextThumbnail = get_the_post_thumbnail($nextPost->ID, array(150,150) ); | |
print_r($nextThumbnail); ?> | |
</a> | |
<?php } ?> | |
</span> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment