hussan
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
hi,
i put that code in /root_wordpress/directory/test.php
thanks
Hi,
no, this code isnt in root of wordpress instalation.
thanks
Hi,
i have a custom type called mynews and i am trying add a post with xmlrpc.
here is the code:
<? require("xmlrpc/class-IXR.php"); $client = new IXR_Client('http://mysite.com/xmlrpc.php'); $USER = 'user'; $PASS = 'pass'; $content['title'] = 'Test title '.mt_rand(); $content['categories'] = array(""); $content['post_type'] = 'mynews'; // $content['custom_fields'] = array( array('key' => 'post_type','value'=>'downloadimpresa') ); $content['description'] = '<p>Lorem ipsum dolor sit amet</p>'; $content['mt_keywords'] = array('foo','bar'); if (!$client->query('metaWeblog.newPost','', $USER,$PASS, $content, true)) { die( 'Error while creating a new post ' . $client->getErrorCode() ." : ". $client->getErrorMessage()); } $ID = $client->getResponse(); if($ID) { echo 'Post published with ID:#'.$ID; } ?>when i try execute this code i have an error:
Error while creating a new post 401 : invalid post typeCan help me?
thanks
Hi,
i am trying add a custom post with xmlrpc , can i do it?
and, yes is post_type..
thanks
Viewing 4 replies - 1 through 4 (of 4 total)