WordPress.org

Ready to get started?Download WordPress

Forums

How to use next_post_link or previous_post_link for parent/child categories. (6 posts)

  1. yankeefan2225
    Member
    Posted 4 years ago #

    Hi all.

    <?php echo "←"; ?><?php previous_post_link('%link &raquo;', '%title', TRUE,''); ?>
    <?php next_post_link('%link &raquo;', '%title', TRUE,''); ?> <?php echo "→"; ?>

    So what I'm trying to do here is to get links for the previous and next posts in the category, but inside the same child category, not just inside the same parent category, is this possible?

    Thanks!

  2. trixienolix
    Member
    Posted 4 years ago #

    i'm after the same thing... anyone got any ideas?

  3. Tzaddi
    Member
    Posted 4 years ago #

    Me too! I have been searching high and low for this. No luck so far.

  4. esferapublica
    Member
    Posted 4 years ago #

    same problem here, anybody an idea?

  5. Gerald Cox
    Member
    Posted 4 years ago #

    I need the same behavior. The old next_post function says that it will not work for child categories: http://codex.wordpress.org/Function_Reference/next_post

    But the newer next_post_link says nothing about this limitation.

  6. rhysbwaller
    Member
    Posted 4 years ago #

    +1
    I would also like the option to display the next/prev post's category (as a hyperlink to the archive page) just like you can display the title using %title. This would then allow the next/prev links to be displayed without restricting to the current category, but the indication of what it belongs to.

Topic Closed

This topic has been closed to new replies.

About this Topic