views:

375

answers:

3

Wondering is there a way so that you can post an article to Wordpress directly from your own PHP code. I want to post in my own standalone wordpress from my php page which should call the hosted wordpress 2.8.6 version and post an article with images (create thumbnail automatically). Is it possible?

+1  A: 

As an alternative to PHP script, you can use Yahoo to do so if you find this interesting, here is the link:

http://wordpressmodder.org/how-to-post-to-your-wordpress-site-directly-from-yahoo-mail-570.html

Sarfraz
A: 

Uses Wordpress's existing XMLRPC functions: Post on your WordPress blog using PHP

songdogtech
+2  A: 
global $user_ID;
$post = array();
$post['post_type']    = 'post';
$post['post_content'] = 'Put your post content here';
$post['post_author']  = $user_ID;
$post['post_status']  = 'publish';
$post['post_title']   = 'Your Post Title';
$postid = wp_insert_post ($post);
if ($postid == 0) 
  echo 'Oops!';
else
  echo 'Snazzy!';

From: http://wordpress.org/support/topic/254439

MikeSchinkel