【问题标题】:How to change the number of posts that Wordpress JSON Api loads per page如何更改 Wordpress JSON Api 每页加载的帖子数量
【发布时间】:2015-11-24 05:25:27
【问题描述】:

如何更改 WordPress JSON API 每页加载的帖子数量。

默认是 25,因为网络连接低我想减少它。

【问题讨论】:

    标签: php json wordpress api


    【解决方案1】:

    正如in the documentation 解释的那样,您可以在请求中使用count 参数指定响应中的最大帖子数。

    配置用户友好的永久链接的示例:

    http://www.example.org/api/get_posts/?count=10
    

    【讨论】:

      【解决方案2】:

      如果您使用的是较新的 WordPress 版本,请参阅他们的文档

      https://developer.wordpress.org/rest-api/reference/posts/#arguments

      per_page 参数现在使用.. 喜欢

      https://www.example.org/api/get_posts/?per_page=100
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-10-17
        • 1970-01-01
        • 2019-05-28
        • 1970-01-01
        • 2023-01-09
        • 1970-01-01
        • 2013-02-09
        相关资源
        最近更新 更多