WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/get boundary post

Contents

Description

Get the first or last post by publish date

Usage

<?php get_boundary_post$in_same_cat$excluded_categories$start ); ?>

Parameters

$in_same_cat
(boolean) (optional) Whether post should be in same category.
Default: false
$excluded_categories
(string) (optional) Excluded categories IDs.
Default: ''
$start
(boolean) (optional) True to begin at the beginning
Default: true

Return Values

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

Examples

Notes

get_boundary_post() will set the post pointer to the first post.

Change Log

Since: 2.8.0

Source File

get_boundary_post() is located in wp-includes/link-template.php.

Related

See also index of Function Reference and index of Template Tags.