0

I'd like to be able to return the most recent Wordpress post from my blog using the WP-API (Version 2).

I can't work out what to put after:

/wp-json/wp/v2/

Any help is much appreciated. - Thanks.

4

3 回答 3

1

尝试这个 -/wp-json/wp/v2/posts?filter[posts_per_page]=1

于 2015-12-14T10:31:22.820 回答
1

根据文档,您使用参数指定要在一个请求中返回的记录数,per_page因此/wp/v2/posts?per_page=1只会返回第一个帖子。

于 2021-07-09T08:22:35.097 回答
0

公共页面:string = " posts?per_page=num&offset=num&_embed&category_id=num ';";

' category =num' 可以交替使用。

于 2020-07-31T21:19:55.557 回答