2017-02-10 77 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