WordPress.org

Ready to get started?Download WordPress

Forums

Synchronizing or Duplicating Custom Post to Main Site (4 posts)

  1. kirkward
    Member
    Posted 1 year ago #

    I have a multisite network installed at http://taxtutor.com. On each of the subdomain sites, I have a "Find Us" post which shows a map to the sites "store" location. On the main site, I have a "Where We Are" post where I wish to show the location of all "stores" in the network.

    For the mapping, I use a plugin called "Pazzey's Store Locator" which creates a custom post type and then aggregates all of the custom post types into a map with a single shortcode.

    In other words, I can have from one to a gazillion store indicators in a single map, with one indicator for each store locator custom post type post.

    With this ability, I feel I can aggregate all the locations into a single map on the main site. Howsomeever ... if I get a lot of sites, or "stores" in the network, it will be a lot of work to keep the map on the main site updated.

    So, I would like to find a way to dynamically import the store locator posts from each site, or synchronize the main site with all the sites in the network.

    I have tried rss feeds, an autoblog plugin, and have done a lot of web searching trying to find a method.

    Is there a way I can achieve the outcome I am striving for?

    Thanks,
    Kirk

  2. Curtiss Grymala
    Member
    Posted 1 year ago #

    Have you looked at all at the WPMU Sitewide Tags plugin? I don't remember anymore whether that allows you to choose which post types are syndicated or not; but if it does, that might work for you.

  3. kirkward
    Member
    Posted 1 year ago #

    I have not tested it, but the posts I read here indicated that it would not work in my situation. I am thinking of coding a plugin ... having only ever cobbled one together before in my whole life ... to see if I can get the post by going to site and returning to site.

  4. kirkward
    Member
    Posted 1 year ago #

    I have found this code on another forum, but am not sure how to use it.

    I want to get all new posts of post_type=my_custom_type and have them added to blog_id[1] as post_type=my_custom_type

    Other than changing the post_type, how would I have to alter this code (which is limited to 5 posts) to do what I wish?

    $globalcontainer = array();
    foreach( $blogs as $blog ) {
        switch_to_blog( $blog->blog_id );
        $globalquery = get_posts( 'numberposts=5&post_type=any' );
        $globalcontainer = array_merge( $globalcontainer, $globalquery );
        restore_current_blog();
    }

    Thanks in advance!

Topic Closed

This topic has been closed to new replies.

About this Topic