Codex

Function Reference/wp get single post

Contents

Description

Retrieve a single post, based on post ID.

Usage

<?php wp_get_single_post$postid$mode ?>

Parameters

$postid
(integer) (optional) Post ID.
Default: 0
$mode
(string) (optional) How to return result. Expects a Constant: OBJECT, ARRAY_N, or ARRAY_A.
Default: OBJECT

Return Values

(object|array) 
Post object or array holding post contents and information with two additional fields (or keys): 'post_category' and 'tags_input'.

Examples

Notes

Change Log

Since: 1.0.0

Source File

wp_get_single_post() is located in wp-includes/post.php.

Related

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