My CPT is created using a plugin so i cannot edit the supports parameter to add support for custom fields.
I tried using this code however it doesn't work either
add_action('init', 'custom_child_init');
function custom_child_init() {
add_theme_support( 'custom-fields' );
}
How do i enable the custom field meta box on the Edit Page screen for single custom post types?
My CPT is created using a plugin so i cannot edit the supports parameter to add support for custom fields.
I tried using this code however it doesn't work either
add_action('init', 'custom_child_init');
function custom_child_init() {
add_theme_support( 'custom-fields' );
}
How do i enable the custom field meta box on the Edit Page screen for single custom post types?
Share Improve this question asked Sep 26, 2019 at 12:51 Brad DaltonBrad Dalton 6,9852 gold badges36 silver badges47 bronze badges1 Answer
Reset to default 2Try with this. just change CPT
with your post type.
function wpcodex_add_excerpt_support_for_cpt() {
add_post_type_support( 'CPT', 'custom-fields' );
}
add_action( 'init', 'wpcodex_add_excerpt_support_for_cpt' );