Previous works… Next does NOT
-
I have a site with a broken Prev / Next links. While the Previous seems to mostly work, the Next does not. It always points to the same, incorrect post. If you visit that post, then you get trapped in a short but endless loop. When you get to the ‘end’ you simply bounce to a prior post rather than staying at the end of the list (link being hidden).
What I want is for the Prev and Next to work within the category of the post being viewed (I’ve set stay_in_cat to TRUE and added three catIDs to ignore). Even that isn’t working – it isn’t ignoring the “Featured”, “Editor’s Blog” and “Staff Picks” categories, isn’t staying within the “interview” or “ee-tips” categories, but simply going Previous through all the posts (and Next always to the same wrong post).
This is the code that is in the single.php file:
<span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">←</span> Previous: <em>%title</em>', 'cc_main' ), true, '5,7,13', 'category'); ?></span> • <span class="nav-next"><?php next_post_link( '%link', __( 'Next: <em>%title</em> <span class="meta-nav">→</span>', 'cc_main' ), true, '5,7,13', 'category' ); ?></span>Here’s the website http://circuitcellar.com
The topic ‘Previous works… Next does NOT’ is closed to new replies.