get_previous_post

Definition:
function get_previous_post($in_same_cat = false, $excluded_categories = '') {}

Retrieve previous post that is adjacent to current post.

Parameters

  • 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_previous_post($in_same_cat = false, $excluded_categories = '') {

	return get_adjacent_post($in_same_cat, $excluded_categories);

}

1641

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:

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

%d bloggers like this: