I have a WordPress 3.9.1 site on domain1.com. I also have a custom PHP 5 site on domain2.com. These two sites are on separate servers, but could be hosted on the same server if needed (although not preferred). My goal is to create a WP post in PHP from domain2.com to domain1.com. I've done some research on the WordPress APIs and it looks like I can use XML-RPC or install some plugins that expose web services. I'm having trouble finding good code examples of how to do this. Also, I'm looking for the best practices on how to accomplish this task. Desired approach would be to create the WP post via a web services, preferably REST.
Asked
Active
Viewed 77 times
1 Answers
0
You could read this great article: http://code.tutsplus.com/articles/xml-rpc-in-wordpress--wp-25467 It describes how you can post something via XML-RPC in OOP style.

Dennis Ziolkowski
- 737
- 6
- 14
-
This is just what I was looking for. However, the code is breaking and not throwing any errors when reaching the 'xmlrpc_encode_request' method. I did some research and found out that I'll need to install the xmlrpc extension. I've done this by adding "extension=xmlrpc.so" in my php.ini, but then found out the xmlrpc.so file is not in my extensions folder. Any additional input on how to install/enable xmlrpc? I'm using MAMP on OSX Mavericks. – Josh Aug 04 '14 at 19:21
-
Thanks for the response. I was actually trying that right as you were responding. For whatever reason, it doesn't seem that the extension is being included. I copied xmlrpc.so to my extensions path and then added the reference extension above to php.ini. Still nothing. I checked phpInfo and it says I'm using php5.5.10, so that's the php.ini I'm using. Any other thoughts? – Josh Aug 04 '14 at 19:48
-
Hmm. Sorry. Nothing left here. – Dennis Ziolkowski Aug 04 '14 at 23:41