WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
Gridview to include events from all blogs on the site? (5 posts)

  1. steilenhang
    Member
    Posted 2 years ago #

    Hi!

    I am new to wordpress and The Events Calendar, so go easy on me.

    I have a wordpress-site with sevral sub-blogs on it (if that is what you call it). The Events Calendar is used globaly for all blogs. What I really would have wanted was to make the gridview show events from sevral blogs, not just the current one you are visiting. Lets say I want the gridview to include events from blog 1, 4 and 8. Is that possible?

    By the way, thanks for a great plugin!

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Ah, that's an interesting request. Not sure how this is doable (it'd probably require some customization on your end) but let me see if anybody from our dev team has a suggestion to point you in the right direction. Thanks for the words so far!

  3. Nick Ciske
    Member
    Posted 2 years ago #

    Quick Answer
    Yes, it's possible, but not easy.

    Long Answer
    WordPress multisite saves each site's data in a separate set of tables. Each site's wp_db object only knows about it's tables. There's a nifty function called switch_to_blog() that allows you to grab data from other site's tables, but it's *very* slow as everything has to be dumped and reloaded every time you switch. Plus you have to cram all the queries together, sort them to get everything in order, then display them.

    The better way would probably be to hook into the save/edit/delete function(s) and have all events saved/updated (as duplicates) to a single site then use that as the data source for your combined events table. That way the heavy lifting is on the backend and not on every request. But that's no walk in the park either... and may not be completely possible without adding some hooks to the core plugin files -- I can't remember if we have hooks for all those scenarios in there yet.

    If you do attempt it (or hire a dev to do so) good luck and let us know how it goes.

    http://codex.wordpress.org/Function_Reference/switch_to_blog

  4. steilenhang
    Member
    Posted 2 years ago #

    Thank you for your answer. I did not realise that it would be so tricky. I think I will have to look at some other solutions.

    Thank you again.

  5. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Thanks, Nick!

    Steilenhang: If you have any other questions down the road, let us know. Happy to help when we can.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic