add_action( 'cmb2_init', 'yourprefix_register_about_page_metabox' ); function yourprefix_register_about_page_metabox() { // Start with an underscore to hide fields from custom fields list $prefix = '_yourprefix_about_'; /** * Metabox to be displayed on a single page ID */ $cmb_about_page = new_cmb2_box( array( 'id' => $prefix . 'metabox', 'title' => __( 'About Page Metabox', 'cmb2' ), 'object_types' => array( 'page', ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => true, // Show field names on the left ) ); $cmb_about_page->add_field( array( 'name' => __( 'Test file', 'cmb2' ), 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefix . 'image', 'type' => 'file', ) ); $cmb_about_page->add_field( array( 'name' => __( 'Test image list', 'cmb2' ), 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefix . 'imagelist', 'type' => 'file_list', ) ); }