2

I'm currently building an Ionic app that uses the Wordpress api. I can retrieve posts in a specific category by using the following:

// Retrieve filtered data for the categories to show posts.
    function getCategoryName(categoryName) {
        return ($http.get(svampeURL + 'posts?categories=' + categoryName).then(handleSuccess, handleError));
    }

The problem is that it only returns 10 as it is some sort of default. I have tried using the per_page=50 argument but it doesn't seem to work. I have also read the documentation of the api and it seems like they don't describe this scenario.

Is there any way to get more than 10 posts in a specific category? How do I change this default return?

1 Answer 1

8

See if your url is correct. Example: website.com/wp-json/wp/v2/posts/?categories=3&per_page=‌​50

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.