• Resolved virtualgeorge

    (@virtualgeorge)


    Someone at wpmudev posted a response about displaying content from one site (master template site) on the same page contained in all the sub-sites. Would anyone be able to shed a little more light on how difficult this would be? I didn’t really understand. I was going to use a plugin called threeWP broadcast and just curious if the custom query method would be better or use less code but couldn’t find any examples. Just trying to be able to update the page on all sites at the same time as they will have the same page & content. I will post the comment from wpmudev below.
    thanks!

    What I meant is, when you create a theme, you need to create a page with custom query: https://codex.www.ads-software.com/Class_Reference/WP_Query

    So, using WP_Query, you need to get post/page or other data from the main site. You can switch to main site using

    switch_to_blog(1);

    and restore to current log using:

    restore_current_blog();

    So, the content is coming from main site, doesn’t matter in which subsite the theme is activated.

    Hope it helps ?? Please feel free to ask more question if you have.

    Cheers
    Ash

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creating a page with custom query…’ is closed to new replies.