Support » Multisite » Replacing switch_to_blog

Replacing switch_to_blog

  • I’m working on a multisite instance where I need to pull in posts from a subsite, into the main site. It looks like switch_to_blog used to do this, in WPMU, but it no longer works.


    So I created a function to grab the latest X posts from a given blog’s table directly (via wpdb), and then a second function to grab some additional post meta information. I built a loop to display the posts. It’s mostly working, but now I’ve increased my mysql queries by 50, and my page rendering time has gone up from .415 seconds to 1.6 seconds.

    anything I can do to cut this down?

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Replacing switch_to_blog’ is closed to new replies.
Skip to toolbar