1

My friend has an site with WordPress 4.6.3, after Wordpress REST API vers 2 plugin was installed, added add_action() to function.php to enable API REST to custom post type.

With this http://www.mysite.it/wp-json/wp/v2/portfolio json contains only 10 data insted 71.

How can I fix it? Thanks!

1
  • 1
    search for info about pagination
    – David Lee
    Feb 24, 2017 at 17:03

1 Answer 1

0

By default WordPress return 10 posts per pages. To change the number of posts per page you should query http://www.mysite.it/wp-json/wp/v2/portfolio/?per_page=71. The max is 100 posts per request.

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.