Use (custom) fields from WP API

Hey,
how is it possible to use additional fields from WP API? For now, it seems that it’s filtered and I have to adapt wp-source to set additional fields in the models, is that correct or is there an easier option, maybe with adapting a configuration?

Thank you!

You just need to expose the custom fields in the REST API.

For ACF, that’s made with a plugin: https://wordpress.org/plugins/acf-to-rest-api/

For other custom fields, you’d need to either add them yourself or use a plugin like https://wordpress.org/plugins/wp-rest-api-controller/

One they are in the REST API response, you’ll be able to access them in Frontity, just like you access the title or content .

2 Likes