Pagination within category / with category exclusion
-
How can I get the Koji single pagination to only provide next and previous links within the category corresponding to this post? Or an alternative is to exclude a specific category from the previous and next links.
I got as far as realizing this can be done using $in_same_term or $excluded_terms arguments to previous_post_link() and next_post_link(). What I cannot determine is how to use these in the Koji theme to get pagination to only provide links within the current category (or not within a specific category). The following changes to pagination.php does not work: `
`<nav class=”link-pagination<?php echo $pagination_class; ?>”>
<?php if ( get_previous_posts_link() ) : ?>
<?php previous_posts_link( __( ‘← Previous Page’, ‘koji’ ), $excluded_terms = “23”); ?>
<?php endif; ?><?php if ( get_next_posts_link() ) : ?>
<?php next_posts_link( __( ‘Next Page →’, ‘koji’ ), $excluded_terms = “23” ); ?>
<?php endif; ?></nav><!– .posts-pagination –>
- The topic ‘Pagination within category / with category exclusion’ is closed to new replies.