Support » Developing with WordPress » Change Next/Previous Post Link Order

  • bibliofille

    (@bibliofille)


    Is there a way to manipulate/filter the order when using Next/Previous post links?

    I have a CPT called People and I have the single-people.php file set up to

    Here is that code:

    <?php if( is_singular('people') ) { ?>
    <div class="post-nav">
    <div class="alignleft prev-next-post-nav"><?php previous_post_link( '%link', '« Previous Artist', TRUE, ' ', 'people' ); ?></div>
    <a href="<?php echo esc_url( home_url( 'njapf-test/' ) ); ?>" class="program-overview-button">Program Overview</a>
    <div class="alignright prev-next-post-nav"><?php next_post_link( '%link', 'Next Artist 	»', TRUE, ' ', 'people' ); ?></div>
    </div><?php } ?>

    Right now that code is working in that it’s navigating only within the People CPT.

    I have a custom page template with a query displaying posts within People in ascending order by last name (or well, by last word in the title).

    Is there a way to have the next/previous post links mimic that same ordering? Right now it looks like it’s filtering by post date.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change Next/Previous Post Link Order’ is closed to new replies.