CMB2 not working in my WordPress theme
Change $prefix = ‘_yourprefix_’; to $prefix = ‘_wp’; or add the code below directly to functions.php add_action( ‘cmb2_admin_init’, ‘register_testimonial_metabox’ ); function register_testimonial_metabox() { $prefix = ‘_wp’; $cmb_demo = new_cmb2_box( array( ‘id’ => $prefix . ‘metabox’, ‘title’ => __( ‘Homepage Custom Fields’, ‘cmb2’ ), ‘object_types’ => array( ‘page’, ), // Post type ‘show_on’ => array( ‘id’ … Read more