0

I am using a custom post type with 9 posts. Whichever post I click on the_post_navigation shows the same post. When I go to that post it shows the only other post in its taxonomy. From then on I can only navigate between the two posts in this taxonomy. I'm using the code below:

$args = array(
    'prev_text' => '<span class="meta-nav">&lt;</span> Previous: %title',
    'next_text' => 'Next: %title <span class="meta-nav">&gt;</span>',
);
echo get_the_post_navigation( $args );
2
  • That's odd — the code works fine for me! You could check to see if there are any filters being applied that might cause a conflict. A fast way to test if there's anything funny going on would be to change the theme and use the Health Check and Troubleshooting plugin to disable plugins temporarily. Sep 18 at 4:59
  • Having looked at the query using the query monitor plugin, it seems as if the query looks for posts that are older or newer than the current post. All the posts were created on the same day except one. if SQL ignores the time and only goes on the date, it would explain it.
    – Badger
    Sep 19 at 10:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.