2017-02-10 73 views
0

我想为wordpress网站制作android应用程序。但无法获得帖子的JSON。我试着用两个插件These are the plugins of the website 为JSON没有从wordpress获取JSON

  1. WP REST API
  2. JSON API

WP REST API将返回该

[] 

和JSON API将返回该

{ 
    "status": "ok", 
    "count": 0, 
    "pages": 0, 
    "category": { 
    "id": 21, 
    "slug": "maths", 
    "title": "Maths", 
    "description": "", 
    "parent": 13, 
    "post_count": 3 
    }, 
    "posts": [] 
} 

根据我这个问题是由于任何其他插件。但我无法使用JSON 1.用JSON API插件我使用这个链接http://iitianlogic.com/custom/get_category_posts/ 和张贴ID = 4

+0

你可以更新您使用请求JSON代码的问题? – tjfo

回答

1

请求的URL不正确,请尝试以下办法来解决问题

API下未归类类别http://iitianlogic.com/api/core/get_category_posts/?slug=uncategorized

希望URL显示其职位,这将工作

+0

你也可以尝试像这样:http://iitianlogic.com/api/core/get_category_posts/?category_id=4如果你有[&post_type = <你的文章类型>]请添加文章类型 – Tristup