Fetch Posts from Another Site

If you’re using WordPress Multisite you may be running a bunch of inter-related sites. I wanted to pull posts from one site to another within a group of community websites. This turns out to be really easy to do using a function called ‘switch_to_blog’. Just use the following code in a template within the destination site to switch to the source site – site #1 in this example: