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
    search for info about pagination – David Lee Feb 24 '17 at 17:03
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, privacy policy and cookie policy

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