• 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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Can you replicate the problem using the default Twenty Fourteen theme with all plugins deactivated?

    Thread Starter Chris Rakoczy

    (@circuitcellar)

    I cannot change the theme or deactivate plugins. It’s a live site, partly managed by another vendor. We’re restructuring the whoel category system, but I need to ensure the Prev Next functions work even a little before trying that project. Even if the Next worked the same as the Prev for now, I would be happy.

    I’m sorry but there is no magic bullet in these situations. This is just the start of basic troubleshooting and is a process of elimination deliberately designed to locate the root cause as quickly as possible by first removing the most obvious and common culprits via a series of (often) temporary steps.

    Your theme & plugin settings are saved in your database and should be retained for future use.

    Thread Starter Chris Rakoczy

    (@circuitcellar)

    Has this been observed before by anyone else: the same code being used for both previous_post_link and next_post_link, but different behaviors? If so, it might help me to dig through the category assignments and theme files a bit to see if I can find the point of failure.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Previous works… Next does NOT’ is closed to new replies.