• I have the following code in my single php:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <?php the_content(__('Continuare')); ?>
    <div class="hr"></div>
    <?php previous_post_link('%link', '<span class="fl">« previous page</span>', TRUE); ?>
    <?php next_post_link('%link', '<span class="fr">next page »</span>', TRUE); ?>
    
    <?php endwhile; else: ?>
    <p><?php _e('Some text here'); ?></p>
    <?php endif; ?>

    This code diplayes a link to the previous and next articles in the same category, but it’s working on posts from one category, but fails to show the next page link in another category, while sitll dislaying previous page link.

    Anyone have an idea why and what can I do for it to work consistently?

  • The topic ‘next_post_link() displayed in one category but not in other’ is closed to new replies.