Ecommerce Single Product Next Product Link

I have tried using the default wp next and previous link but when click it would go to another category post instead of the next post(product)

previous_post('laquo; laquo; %', 'previous', 'yes'); 
next_post('% raquo; raquo; ', 'next', 'yes'); 

when i try to put yes for the same category, the previous and next title disappears

previous_post('laquo; laquo; %', 'previous', 'yes','yes'); 
next_post('% raquo; raquo; ', 'next', 'yes','yes'); 

I also tried using

wpsc_first_products_link
wpsc_last_products_link

Topic navigation plugin-wp-e-commerce Wordpress

Category Web


next_post function is deprecated.

You should try this instead: next_post_link and previous_post_link

The basic way to use it is like so: This will link to the next post or prev post.

<?php 
    next_post_link( '%link', '%title' );
    previous_post_link( '%link', '%title' ); 
?>

If you would like to link to the next post in the same category, add true after '%title'. This will work for the default posts and category.

<?php 
    next_post_link( '%link', '%title', true ); 
    previous_post_link( '%link', '%title', true ); 
?>

If you are using a CUSTOM POST TYPE with a CUSTOM TAXONOMY (like a product post), then you have to tell the function which taxonomy to look for the next post. eg.

<?php 
    next_post_link( '%link', '%title', true, '', 'custom_taxonomy' ); 
    previous_post_link( '%link', '%title', true, '', 'custom_taxonomy' ); 
?>

All the above examples have been tested and working.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.