我目前正在构建一个使用Wordpress api的Ionic应用程序。我可以使用以下方法检索特定类别中的帖子:
// Retrieve filtered data for the categories to show posts.
function getCategoryName(categoryName) {
return ($http.get(svampeURL + 'posts?categories=' + categoryName).then(handleSuccess, handleError));
}问题是它只返回10,因为它是某种类型的默认。我尝试过使用per_page=50参数,但它似乎不起作用。我还阅读了api的文档,它们似乎没有描述这个场景。
有没有办法在一个特定的类别中获得10个以上的职位?如何更改此默认返回?
发布于 2017-07-27 17:15:01
看看你的网址是否正确。示例:website.com/wp-json/wp/v2/posts/?categories=3&per_page=50
https://wordpress.stackexchange.com/questions/274890
复制相似问题