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.
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.
尝试这个 -/wp-json/wp/v2/posts?filter[posts_per_page]=1
根据文档,您使用参数指定要在一个请求中返回的记录数,per_page
因此/wp/v2/posts?per_page=1
只会返回第一个帖子。
公共页面:string = " posts?per_page=num&offset=num&_embed&category_id=num ';";
' category =num' 可以交替使用。