• I have the following and it will lists the custom post type correctly, however when viewing the post itself I get a 404 as that custom_post_type does not reside on blog 2. How can I view the post from blog 1 post on blog 2? I am stumped!

    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    //blog1
    switch_to_blog(1);
    query_posts(  array (
        'posts_per_page' => 3,
        'post_type' => 'gtnewsletter',
        'order' => 'DESC',
        'orderby' =>'date',
        'paged' => $paged ) );
    restore_current_blog();
    $_main_blog  = $wp_query->posts;
    //blog 2
    query_posts(  array (
        'posts_per_page' => 3,
        'post_type' => 'gtnewsletter',
        'order' => 'DESC',
        'orderby' =>'date',
        'paged' => $paged ) );
    
    	$wp_query->posts = array_merge( $_main_blog, $wp_query->posts );
        $wp_query->post_count = count($wp_query->posts);
    
    while ( have_posts() ) { the_post();
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Two Blog Ids in one Loop’ is closed to new replies.