I am using the the_post_navigation()
function in WordPress like this:
<?php the_post_navigation( array(
'prev_text' => __( 'Previous item'),
'next_text' => __( 'Next item'),
)); ?>
This navigation goes through all my posts, but I want to exclude the posts that contain the category ‘footer’. How do I do this?
I have used this to let the page redirects itself when the single.php goes to a post with the category ‘footer’:
(Works only when places above
get_header();
.Not the most beautiful solution, but it works (only for next post unfortunately)