Categories

Retrieving an individual page using XML-RPC

To retrive an single post you will need to invoke the wp.getPage method. This method require 4 parameters $blog_id, $page_id, $user_name, $user_password.

<?php
include_once('wp-includes/class-IXR.php');
 
define('BLOG_ID', 0);
define('RPC_USERNAME', 'sanraul');
define('RPC_PASSWORD', '******');
define('PAGE_ID', 2);
 
$client = new IXR_Client('http://localhost:8888/xmlrpc.php');
$client->query('wp.getPage', BLOG_ID, PAGE_ID, RPC_USERNAME, RPC_PASSWORD);
$post = $client->getResponse();
 
echo json_encode($post);
?>

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

IMPORTANT! To be able to proceed, you need to solve the following simple math (so I know that you are a human) :-)

What is 7 + 5 ?
Please leave these two fields as-is: