get_next_post parameters not working
-
Hi, I am using get_next_post for woocommerce products. It works fine but only if I don’t add any parameter. As I want it to wrok within a product category I need to set that parameter to ‘true’, but this makes the ‘next’ link disappear…any help/idea would be super appreciated!
My not working code is:
<?php $next_post = get_next_post(true); if (!empty( $next_post )): ?> <a href="<?php echo get_permalink( $next_post->ID ); ?>">prev</a> <?php endif; ?>
If I delete ‘true’ it works
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_next_post parameters not working’ is closed to new replies.