Multisite query questions

Hello all,
I'm highly debating making my buddypress a multisite, but am a little confused on my own reasoning to do so.

Basically I want too provide separate post type queries/ indexes / single posts from different regions of different sites.

For an example:
I am creating a site about horses and want to give each region their own

Main site: myhorses.com

Regional site examples: california.myhorses.com
newyork.myhorses.com

The main site will have 3 post types. Post type A,B,C.

The regional site will have post type D and hopefully a bbpress forum specific to its area.

What I'm wondering is

A) Can my regional site have a forum that's specific to it only and seperated from other regions? (sorry I'm new to multisite so this might be a noob question)

B) I would like to show the Post types A,B and C from my main site on my regional sites, but can't figure out if there is a way to query it

D) Would a single post from the mainsite maintain its regional Url when being clicked on from the regional site?

Ex california.myhorses.com/post-type-a/mainsite-singlepost

Just Freethinking I could probably always make a JSON feed out of the main site and query it in that way if its not possible.

Thanks again!

  • Michael Bissett

    Hey @Corbin, hope you're doing well today. :slight_smile:

    A) Yes, this would be possible. :slight_smile:

    B) This looks to be possible, if you were to take the code mentioned here:

    http://wordpress.stackexchange.com/a/101265

    And turn that into a mu-plugin:

    http://www.newnine.com/learn/how-to-create-a-wordpress-mu-plugin

    You'd have to add in each post type to be pulled from the main site, since you're wanting three of them. If you're needing more direction with this, please let me know. :slight_smile:

    D) Not to my knowledge, it should keep the same URL structure as the main site, since that's where it's coming from..

    Hope that helps!

    Regards,
    Michael

  • Corbin

    Thank you very much Michael!

    B) I would just use a mu plugin just so the loops are regional sites then?

    D) Since users will be clicking on posts indexed on the regional sites that will be post types of the main site; I would need a way to keep the URL from the regional site I clicked off of so users could still use the regional nav bar to get back to the parts of the regional site. I would also like to use recent post widgets to display post from the regional site. Am I right?

    If so any ideas how I would be able to do this or get around it to get the desired effect?

  • Ash

    Hi @Corbin

    I hope you are well today.

    B) I would just use a mu plugin just so the loops are regional sites then?

    If you use a mu plugin that will work in all subsites in your network. Muplugin means must use plugins, and it doesn't need to be activated.

    D) Since users will be clicking on posts indexed on the regional sites that will be post types of the main site; I would need a way to keep the URL from the regional site I clicked off of so users could still use the regional nav bar to get back to the parts of the regional site. I would also like to use recent post widgets to display post from the regional site. Am I right?

    I think you need to develop a custom plugin to achieve this. So that a regional subsute can pick the posts from a custom post type of main site based on the region.

    Cheers
    Ash

    • Corbin

      Thanks for the reply Ash

      I think you need to develop a custom plugin to achieve this. So that a regional subsute can pick the posts from a custom post type of main site based on the region.

      A) So I would need to make a plugin so a subsite can grab posts from a custom post type of the main site? If so I get that.

      based on the region.

      Is the only part I'm kind of lost on.

      B) Assuming I have a pretty decent knowledge of plugin development; Do you think you could give me a pretty brief run down on how I might be able to achieve this? (Database calls, wordpress functions needed, ect) Just kind of like a workflow idea as to how I might be able to do this?

      C) Do you think there might be anyway around this to get the desired effect? Like some how create a data table for the post types I want seen across all networks,

      or some how connect it so every time I make make a post on the main site it gets posted to the sub sites automatically (note I kind of see that it could be a headache when it would come time to make new regional sites after the site has been up for some time)

      D) How much work,or how hard do you think this plugin might be? worst comes to worse I'll get the help of a developer.

      Thank you for your awesome ideas and I'm thankful for any further help I get!

  • Michael Bissett

    Hey @Corbin,

    On further thought, there's actually another way you could go about all this:

    - Install New Blog Templates (network activate) & Auto Blog (don't network activate) on your Multisite.

    - Create a template site, and activate Auto Blog on it. Then, set up Auto Blog with a feed for each post type you're wanting to reference (e.g. http://myhorses.com/feed/?post_type=post-type-one).

    - Ensure that the post types on the main blog exist on the template blog as well, and ensure that "Post type for new posts" is set to the correct post type for each feed you're wanting to import.

    - Set "Process this feed" for each feed to the desired interval (can be five minutes, though I might want to have it set to a higher number if the main feed's not updated that often).

    - Now, with each site that's created using the template, it'll be set up to import the content from your main site. :slight_smile:

    Let me know if this helps please!

    Regards,
    Michael

  • Corbin

    Oh wow! I looked into so much new stuff after asking that last question like cross posting and such. This looks better though!

    A) This should work with my gravity forms setup that allows users to post?

    B) "Process this feed", Does that just mean the time it will take to be able to see the main sites posts to the sub sites?

    C) Since I'm using buddypress, can members only register to the main site and then still be granted access to the rest of the sub sites without having to regional sites? Again I'm trying to separate bbpress forums by regional sub sites and would like to allow users to just register to the main site and be able to post on those separate regional forums.

    You help has been wonderful, thank you!

  • Ash

    Hi @Corbin

    A) This should work with my gravity forms setup that allows users to post?

    This will work as long users are able to post via any form, but make sure the post appears correctly in your custom post type admin screen.

    B) "Process this feed", Does that just mean the time it will take to be able to see the main sites posts to the sub sites?

    Yes, but I disagree with Mike about the process. You don't need NBT, just install Autoblog. Let me draw a scenario:

    Your main site: http://site.com
    Regional subsite: http://ny.site.com, http://ca.site.com (assuming only two for now)

    And, you have two custom post types in main site - NY (ny) and CA (ca).
    So, in http://ny.site.com site, you will add the feed in autoblog to import: http://site.com/feed/?post_type=ny
    And for http://ca.site.com the feed with be: http://site.com/feed/?post_type=ca

    So, those posts will be automatically added into the subsites from main site.

    C) Since I'm using buddypress, can members only register to the main site and then still be granted access to the rest of the sub sites without having to regional sites? Again I'm trying to separate bbpress forums by regional sub sites and would like to allow users to just register to the main site and be able to post on those separate regional forums.

    This is the hardest part I think. Let me ask one of our experienced colleague @Patrick Cohen for his valuable opinion on this.

    Cheers
    Ash

  • Corbin

    Last three questions I swear!

    A) Does Auto Blog create duplicate posts and then post them to the sub domains. So if I make a post under post type a, on the main site and set auto blog that post under certain post types. Will that post then appear under those post types on the sub sites? I'm hoping to query them in the same ways on the sub sites.

    B) Will all media be imported from the posts as well?

    C) Still don't know about being able to separate the forums

    Thank you very much for all the help! Sorry I dragged this thread out so much lol

  • Michael Bissett

    Hey @Corbin,

    A) Yes, this would be true. :slight_smile:

    B) Yes, this is possible by enabling the "Image Import" add-on inside of Autoblog. If you've got any featured images, you'll also want to enable the "Featured Image Import" add-on as well, so that they get imported too.

    C) Yes, all of the forums on each sub-site would be separate from the forums on the other sites in your network.

    Hope that helps!

    Regards,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.