bhadaway / blankslate

A naked WordPress theme, powering over 10k websites. Buy me a sandwich. 🥪
https://opencollective.com/blankslate
328 stars 92 forks source link

BlankSlate and ACF #54

Closed ghost closed 11 months ago

ghost commented 11 months ago

Hi, Is the theme compatible with Advanced Custom Field? I set up some fields in ACF, with other themes when I edit the article I can see the fields and I can fill them, with Blankslate I can’t.

bhadaway commented 11 months ago

I can't think of any reason it wouldn't be.

BlankSlate is a classic theme, so it's possible that you also need the Classic Editor:

https://wordpress.org/plugins/classic-editor/

If that doesn't help, the devs on ACF's side might know:

https://support.advancedcustomfields.com/

Perhaps special integration is required.

ghost commented 11 months ago

Hi Bhadaway,

Thank you for your response. I followed your advice, but unfortunately, it didn't work. To be sure, I reinstalled BlankSlate without making any changes, and I still can't see the fields.

I also attempted it with the Twenty Four theme, and the fields are visible (the ACF fields are spotify URL and youtube).

ok

ghost commented 11 months ago

If I add this in function.php I can see the custom fields

add_action('acf/init', 'blankslate_acf_init'); function blankslate_acf_init() { if( function_exists('acf_add_local_field_group') ) { acf_add_local_field_group(array( 'key' => 'group_6544d4dca9626', 'title' => 'Custom Fields', 'fields' => array( // Aggiungi qui i tuoi campi ACF ), 'location' => array( array( array( 'param' => 'post_type', 'operator' => '==', 'value' => 'post', ), ), ), )); } }

fix

bhadaway commented 11 months ago

Thanks for sharing the solution.