Hey guys,
I’ve had a look over the forums but I couldn’t find anything. I’ve got two issues when it comes to including the ACF Pro plugin in a theme.
require_once( INCLUDES . '/plugins/acf-pro/acf.php');
add_filter('acf/settings/path', 'my_acf_settings_path');
function my_acf_settings_path( $path ) {
$path = get_bloginfo('stylesheet_directory') . '/inc/plugins/acf-pro/';
return $path;
}
add_filter('acf/settings/dir', 'my_acf_settings_dir');
function my_acf_settings_dir( $dir ) {
$dir = get_stylesheet_directory_uri() . '/inc/plugins/acf-pro/';
return $dir;
}
The plugin is included correctly and works for the most part but I’ve got two issues.
1. Since you’ve released the 5.0.5 update I’m getting an update notification on the dashboard. I’m looking to include ACF PRO in a premium theme. Is there a way I can remove these notifications?
2. I’m getting blank screens on the Import/Export and Update sections. The Custom Fields are displaying correctly though. Do you know what is causing this?
If I install the plugin using the general methods instead of including it everything works perfectly. I’m probably missing something in the documentation but I’ve gone over it a couple of times.
Thanks.
I’m experiencing the same problem.
The only way I can see to disable the update notification is really hacky ā to change the version number on line 64 of acf.php to something unfeasibly high (so the the current version is always higher than the stable version), and to manage updates manually.
It would be great if there were a way to disable updates when including ACF Pro in a premium theme.
Hi guys
Thanks for the thread. I like the idea of a filter to disable updates so I’ll add that to my to-do list.
As for the path issue. Can you please debug your code and double check that the url/path is 100% correct?
Iām also experiencing problems.
The path is correct (see images at the bottom of this post).
What am I doing wrong?
Here is my code:
include_once( 'acf/acf.php' );
add_filter('acf/settings/path', 'my_acf_settings_path');
function my_acf_settings_path( $path ) {
// update path
$path = get_bloginfo('stylesheet_directory') . '/acf/';
// return
return $path;
}
add_filter('acf/settings/dir', 'my_acf_settings_dir');
function my_acf_settings_dir( $dir ) {
// update path
$dir = get_stylesheet_directory_uri() . '/acf/';
// return
return $dir;
}
Errors: http://www.patrickheiloo.nl/resources/acf/error_codes.png
Empty import/export: http://www.patrickheiloo.nl/resources/acf/empty_screen.png
File structure: http://www.patrickheiloo.nl/resources/acf/structure.png
Hi @Patrick Heiloo
Thanks for the screenshots. I think the path setting may not be correct because it starts with ‘http’. A path should not be a web url, but an absolute path to the file.
Perhaps try using get_stylesheet_directory()
instead of get_bloginfo('stylesheet_directory')
The topic ‘Issues when including ACF Pro in a theme’ 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.