Skip to content

Instantly share code, notes, and snippets.

@morgyface
Last active February 27, 2017 16:42
Show Gist options
  • Select an option

  • Save morgyface/62522daa72f8444f0286d74c47b3e8b6 to your computer and use it in GitHub Desktop.

Select an option

Save morgyface/62522daa72f8444f0286d74c47b3e8b6 to your computer and use it in GitHub Desktop.
WordPress | Getting Posts from another WordPress site
@morgyface
Copy link
Author

morgyface commented Feb 27, 2017

Getting posts from another WordPress site.

I used this when a client had a sister site and didn't want to duplicate the posts.

You obviously need to enter the main sites database details to get it working and the function needs adding to your themes main functions.php file. Then to call it you simply use get_other_posts().

It's fairly crude at the moment, there probably should be additional checks to make sure the $post->post_status is publish.

I hope to develop it further soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment