Post and Page Inheritance to subsites in a WordPress Network

R, the simple solution is to create a 2 post-meta.

The first is “Blog id”
The second is “Post id”

and you use

$blog_id = get_post_custom_values('blog_id');
$post_id = get_post_custom_values('post_id');

if( !empty( $blog_id ) )
switch_to_blog( $blog_id );
    $query = new WP_Query( array( 'p' => $post_id ));
    if( $query->have_posts() ){
        while( $query->have_post() ){
            $query->the_post();   
        }
    }
restore_current_blog();

reference:

  1. http://codex.wordpress.org/Function_Reference/switch_to_blog
  2. http://codex.wordpress.org/Class_Reference/WP_Query

Leave a Comment