function get_next_post($in_same_cat = false, $excluded_categories = '') {}

Retrieve next post that is adjacent to current post.


  • bool $in_same_cat: Optional. Whether post should be in a same category.
  • array|string $excluded_categories: Optional. Array or comma-separated list of excluded category IDs.

Return values

returns:Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.

Source code

function get_next_post($in_same_cat = false, $excluded_categories = '') {

	return get_adjacent_post($in_same_cat, $excluded_categories, false);



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: