Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for WP Rest API paging #1733

Merged
merged 15 commits into from
Aug 10, 2017
17 changes: 0 additions & 17 deletions packages/gatsby-source-wordpress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,6 @@ The Authentication on Wordpress.com is not supported yet. This means that you wo
]
```


### How to raise the default and maximum number of posts to be returned in result set from REST API

To modify the `per_page` `default` and `maximum` arguments add the following to your functions.php

```php
add_filter( 'rest_endpoints', function( $endpoints ){
if ( ! isset( $endpoints['/wp/v2/posts'] ) ) {
return $endpoints;
}
$endpoints['/wp/v2/posts'][0]['args']['per_page']['default'] = 200; // defaults to 10
$endpoints['/wp/v2/posts'][0]['args']['per_page']['maximum'] = 200; // defaults to 100
return $endpoints;
});
```


## How to query : GraphQL

You can query nodes created from Wordpress using GraphQL like the following:
Expand Down
Loading