I’m trying to get started on ACF-JSON, as in the documentation says I have created the acf-json folder in the theme ( twenty-seventeen ) with the permissions 755 (I’ve also tried 777) to write and read, but the ACF-JSON folder still empty.
I’m new in wordpress and ACF and I dont know what is wrong.
Any reply will be appreciated.
Some common reasons for not saving
ACF will only save to the acf-json folder of the current theme. For example you can’t write to the parent theme of a child theme unless you set up a custom save location. Also, ACF will not load json files from the parent theme unless a custom load point is added https://www.advancedcustomfields.com/resources/local-json/
This folder needs to have permissions set to that it can be written to.
If you are creating a theme that will use a child theme then the best practice would be to do all ACF work in the parent theme and set a custom load point to load json files from the parent theme.
Requiring the folder to be in the parent/child theme needs to change. I would suggest wp_uploads basedir /acf-json created by the plugin to store json files. That way, no matter what theme, the data stays the same. I may have a dozen themes in development that all use the same ACF.
If ACF did that then a theme that did not use those fields would still load them. If this is a requirement for your dev environment then it’s something that needs to be done using the json load/save point filters that the developer has given us. Alternately you might try https://github.com/khromov/acf-local-json-manager
I am seeing the same issue.
Just created a new theme and am finishing it off by integrating ACF Pro in theme directory.
This worked fine of course.
Only issue is, that the acf-json directory in my theme’s directory remains empty, even though I tried updating the existing field groups several times.
What am I doing wrong? this is not a child theme.
EDIT: found the issue.
I added the directory using my ssh user. Thus the dir was owned by my ssh user and even though permissions were set to 755, the WordPress installation was unable to write to it, because WP makes use of www-data user (id 33 in my ubuntu install) that is in www-data group (id 33 in my ubuntu install). To solve this issue you must run following command on your vhost directory (replace with user ids or username and group of your server setup:
chown 33:33 -v -R /var/www/path/to/your/domains/rootdir/
The topic ‘ACF-JSON not working’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!