Adding / integrating ACF to a custom WP theme
Question
Im trying to create a free WP theme which will use and include ACF. I have downloaded ACF, put it into the theme folder dir in an includes folder theme > includes > acf
I have them added the following code to initialise the plugin:
// Define path and URL to the ACF plugin.
define( 'MY_ACF_PATH', get_stylesheet_directory() . '/includes/acf/' );
define( 'MY_ACF_URL', get_stylesheet_directory_uri() . '/includes/acf/' );
// Include the ACF plugin.
include_once( MY_ACF_PATH . 'acf.php' );
// Customize the url setting to fix incorrect asset URLs.
add_filter('acf/settings/url', 'my_acf_settings_url');
function my_acf_settings_url( $url ) {
return MY_ACF_URL;
}
Should the ACF plugin show in the WP back-end now or does it work differently when integrated? Theres no show at all of ACF in the settings or plugin section, it’s as if it doesn’t exist at all.
Any help would be appreciated in getting this working from within the theme directory. Thank you
0
2 years
2020-12-29T08:10:20-05:00
2020-12-29T08:10:20-05:00 0 Answers
1 views
0
Leave an answer