【发布时间】:2017-05-25 05:52:48
【问题描述】:
我已经在我的 Wordpress 网站上安装了 wp-json-rest-api,我想将我的网站连接到一个 android 应用程序。 在这样的 url 中,它会获取所有的帖子:
http://mywebsite.com/wp-json/posts
在其中一个 android 页面上,我只想获得帖子的标题,仅此而已。我的意思是我应该如何在 url 或其他任何地方指定我只想要标题和 ID 而不是帖子的所有内容? 例如在每个帖子的页面中,我只想获取该帖子的标题、ID 和内容,类似这样,其中帖子的 ID 为 12:
http://mywebsite.com/wp-json/posts?include=title,id,content/12
但在所有帖子列表等其他页面中,我想要这样的内容:
http://mywebsite.com/wp-json/posts?include=title,id
我该怎么办?
【问题讨论】:
标签: php json wordpress wordpress-rest-api