Support

Account

Home Forums Feature Requests ACF-JSON not working

Solving

ACF-JSON not working

  • 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.

  • After setting up the folder on your server did you go in and re-save all of the field groups on the site? The field groups in the acf-json folder are only updated when you save a field group.

  • I did that. I can’t get them to save. ACF-JSON NOT Saving.

  • 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.

  • This is the snippet I tried to use for ACF local json.

  • 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

  • Not if ACF plugin is not active.

  • Line 34 sets the load/save filter?

    • slitweb

    • September 22, 2019 at 8:07 pm

    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.

    Best
    Saskia

    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/

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.