O'Reilly logo

WordPress Mobile Applications with PhoneGap by Yuxian Eugene Liang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating blog post

Creating blog posts involves two steps: firstly, we need a token from our WordPress website and secondly, we need to post content to the JSON endpoint. The endpoint for getting our token is /?json=get_nonce, and the endpoint for creating a post is /?json=posts/create_post. So let's see how we can do it manually.

Manual creation of posts

In order to create a blog post using JSON-API, WordPress requires you to get a token known as a nonce. Here's how you can create posts manually via JSON-API:

  1. Log in to your WordPress admin and go to Settings | JSON-API. Look for the create_post link as shown in the following screenshot:
    Manual creation of posts
  2. Click on the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required