Getting Custom Post Type content from main-site of a Multisite

I have a multi-site network with 3 sub-sites:

enter image description here

Read More

Is it possible to “link” or include custom post to all 3 sites from the main site?

By include or link I don’t mean to make other sites to edit them, I’m asking for the visual solution.

If possible, could I do that without using a plugin?

Related posts

1 comment

  1. You could use the technique in this Stack Overflow answer, that’s basically:

    switch_to_blog(1); //switch to main site
    $latest_posts = get_posts($args);
    foreach( $latest_posts as $post ) {
        // print post
    }
    restore_current_blog();
    

    Just add 'post_type' => 'your-custom-post-type' to the query.

Comments are closed.