I recently upgraded to ACF Pro, and for some reason my Import/Export page and the Updates page are both empty in the admin panel. I’m not seeing anything in the error logs, any idea what could be causing this?
Note: I have ACF included in my theme rather than installed as a plugin
Setting this value:
add_filter('acf/settings/path', function( $path ){
return '/full/server/parth/wp-content/themes/themename/advanced-custom-fields/';
});
fixed this issue. Is there a way to set this relative to the WP install location rather than a full path? The path will obviously change when I hand my theme off to clients who then use it on their own server.
Hi @bradwiatr
WP contains some handy functions to retrieve urls / paths to the WP installation. Something like this should work a treat:
include_once( get_template_directory() . '/lib/acf/acf.php' );
add_filter('acf/settings/dir', function( $dir ){
return get_template_directory_uri() . '/lib/acf/';
});
add_filter('acf/settings/path', function( $path ){
return get_template_directory() . '/lib/acf/';
});
Hi guys
Just updated the docs with relevant code:
http://www.advancedcustomfields.com/resources/how-to/including-acf-in-a-plugin-theme/
As in current example get_template_directory_uri()
is used:
Note that get_template_directory_uri()
/ get_template_directory()
returns the path to the parent theme if a child theme is used.
Better use get_stylesheet_directory_uri()
/ get_stylesheet_directory()
to always get the currently used theme.
The topic ‘Import/Export page empty’ 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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.