How get afc?

Hi there,

How can I fetch data from afc?
I have WP with different type of pages/templates. Everything works well except pages are created with Advanced Custom Fields. So I have this kind of json …

...
 "meta": {},
"yoast_head": "
"acf": {},
"_links": {}`

I have all that data except “acf” … any idea how can I get that and render.

Hi @vova.champion. I think acf fields aren’t exposed to the REST API by default. So you have to install a plugin ACF to REST API GitHub - airesvsg/acf-to-rest-api: Exposes Advanced Custom Fields Endpoints in the WordPress REST API from your WordPress admin. In that way, it will expose Advanced Custom Fields Endpoints in the WordPress REST API.

I hope this helps.

1 Like