WordPress.org

Ready to get started?Download WordPress

Forums

Integrating multi-site blogs in parent site (4 posts)

  1. mattthr
    Member
    Posted 1 year ago #

    Hi,

    The site I'm working on is for a school. It's got a main site of largely static pages, but each school class has a blog which should be updated every week or so by the teacher.

    To get this working I installed multi site and set up each blog as a sub-site, separate from the main site. However I'm a bit stuck as to how best to integrate the two back again.

    The site has a custom theme. To get this working I created a new index.php which reads have_posts and that seems to work fine.

    However my left sidebar uses wp_list_pages. This presents two problems: first, in my blog sub-sites it displays the pages from the sub-site rather than the main site. Is there any way I can make it read the page list from another site/address?

    The second issue is that "class blogs" is a header page in the main site. On that page there should be a list of the blogs, and in the menu it should have children corresponding to the sub-sites.

    I presume this can't be managed automatically in the sense that wp_list_pages can magically be made to include blogs from sub-sites as child items. But I don't know how best to manage it. Do I need to create a page in the main site to host each blog? If so, how do I modify index.php for my theme to detect that it needs to load a blog and load the appropriate content? Or is there a better way?

    Cheers,
    Matt

  2. How often do these pages/menus change?

  3. mattthr
    Member
    Posted 1 year ago #

    Yearly. Hard-coding them is an option. But I'd prefer to have the platform running as automated and idiot-proof as possible, otherwise it'll be me making the changes when it should be the people in charge of the content.

  4. You could use switch_to_blog to *ahem* switch to site 1, pull in the pages, and then go back.

Topic Closed

This topic has been closed to new replies.

About this Topic