I'm trying to include a few custom fields I've created in my functions.php file so they're native to the theme I'm working on. However they're not showing up on the edit screens of the posts I've set them to.
I've included the acf plugin in my theme by using this code in my functions.php: include_once('advanced-custom-fields/acf.php');
I also exported the fields to php and copy and pasted the code in the functions.php of my theme. Can anyone tell me what I'm doing wrong?
I'm trying to include a few custom fields I've created in my functions.php file so they're native to the theme I'm working on. However they're not showing up on the edit screens of the posts I've set them to.
I've included the acf plugin in my theme by using this code in my functions.php: include_once('advanced-custom-fields/acf.php');
I also exported the fields to php and copy and pasted the code in the functions.php of my theme. Can anyone tell me what I'm doing wrong?
Check that ACF included in your theme, if not than include acf. Try to use following code:
if( !class_exists('Acf') )
include_once get_stylesheet_directory_uri() . '/advanced-custom-fields/acf.php' );
Have you added the custom field into a post?
In my experience, using the custom field in functions.php, plugins, templates, or whatever doesn't put the field as an option in any post. Adding the field manually into any post WILL make it available to any post after that.
And you don't need ACF (Advanced Custom Fields plugin) to use custom fields, unless you want all the fancy options they supply. All you have to do is create a custom field, then start accessing it via appropriate calls to postmeta.