WordPress.org

Ready to get started?Download WordPress

Codex

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

Function Reference/get blog post

Contents

Description

Get a blog post from any site on the network. This function is the same as get_post(), except that it can retrieve a post from any site on the network, not just the current site.

Usage

 <?php get_blog_post$blog_id$post_id ); ?> 

Parameters

$blog_id
(integer) (required) ID of the blog.
Default: None
$post_id
(integer) (required) ID of the post you are looking for.
Default: None

Returns

WP_Post (object) 
Returns a WP_Post object, or null on failure. See get_post() for more information.

Example

Get the post with id 6 from site 3:

<?php

$post_6 = get_blog_post( 3, 6 );

echo $post_6->post_title;

?>

Change Log

Source File

get_blog_post() is located in wp-includes/ms-functions.php.

Related

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.