I have a magazine format where a parent category is an issue, sub categories are the sections and the articles go into their respective sections. When viewing an article in a magazine, I would like to be able to scroll through all the articles in that issue not just the section the articles are in or the whole website, just that issue.

ATM the links go through all of the articles in a section. How can I adapt the code below to make next/previous_post_link link through all of the articles within a magazine?

I know that the TRUE declaration in the code below lets the links cycle through all of the posts and changing it to FALSE makes it go through its parent category but how can you make this go through the top level category?.

code in single.php

<?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'IQ' ) . '</span> %title', TRUE ); ?>
        <?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'IQ' ) . '</span>', TRUE ); ?>

1 Answer 1


You can use Ambrosite Next/Previous Post Link Plus plugin for doing this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.