【问题标题】:Wordpress APIs how to list all posts in category using rest routeWordpress APIs如何使用休息路线列出类别中的所有帖子
【发布时间】:2018-05-29 15:17:12
【问题描述】:

我知道wp-json,但我不能使用它。我需要使用?rest_route
虽然这会返回任何类别的前 10 个帖子
?rest_route=/wp/v2/posts

我想显示特定类别,即60
我尝试过的所有组合都不起作用
IE。 ?rest_route=/wp/v2/posts/?categories=60

有什么想法吗?

【问题讨论】:

    标签: wordpress rest api routes


    【解决方案1】:

    尝试使用 & 而不是 ? 像这样 - http://www.example.com/?rest_route=/wp/v2/posts/&categories=60

    您还可以使用逗号分隔多个类别,例如http://www.example.com/?rest_route=/wp/v2/posts/&categories=60,61

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多