get_adjacent_post WordPress Function

Retrieve adjacent post. Can either be next or previous post.


<?php get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy ) ?>


(boolean) (optiona) Whether post should be in a same taxonomy term.
Default: false
(array or string) (optional) Array or comma-separated list of excluded term IDs.
Default: ”
(boolean) (optional) Whether to retrieve previous post.
Default: true
(string) (optional) Taxonomy name, if $in_same_term is true.
Default: ‘category’

Leave a Reply

Your email address will not be published. Required fields are marked *