WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Function Reference/get boundary post"

m (Usage)
(Source File)
Line 28: Line 28:
 
== Source File ==
 
== Source File ==
 
<!-- Need links to current source code files -->
 
<!-- Need links to current source code files -->
<tt>get_next_post()</tt> is located in {{Trac|wp-includes/link-template.php}}.
+
<tt>get_boundary_post()</tt> is located in {{Trac|wp-includes/link-template.php}}.
   
 
== Related ==
 
== Related ==

Revision as of 10:52, 16 December 2012

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.