Plugin “Meta Box”: Implementing meta boxes in custom post type

In this instance you would need to find the hook into the specific metabox and add your custom post type to its pages array, for example:

$meta_boxes['test_metabox'] = array(
    'id' => 'test_metabox',
    'title' => 'Test Metabox',
    'pages' => array('post','page','artists'), //list custom post types here!
    'context' => 'normal',
    'priority' => 'high',

The Meta Box plugin essentially adds a class that makes it easier to code metaboxes. You still need to actually register and code the metaboxes themselves into your theme’s files (see example below). To display only on your custom post type you need to modify the pages array (to add 'artists' to that array as shown above).

Code example (not tested)

Assuming you’ve got the plug in installed and activated, you should be able to add some text areas and checkbox meta boxes by pasting the following code to your themes functions.php file:

add_filter( 'rwmb_meta_boxes', 't129292_register_meta_boxes' );

function t129292_register_meta_boxes( $meta_boxes ) {

$prefix = 'rw_';
// Register the metabox
$meta_boxes[] = array(
    'id'       => 'personal',
    'title'    => 'Personal Information',
    'pages'    => array( 'artists' ), //displays on artists post type only
    'context'  => 'normal',
    'priority' => 'high',
    'fields' => array(

        // add a text area
        array(
            'name'  => 'Text Area',
            'desc'  => 'Description',
            'id'    => $prefix . 'text1',
            'type'  => 'textarea',
            'cols' => 20,
            'rows' => 3,                
        ),
        // add another text area
        array(
            'name'  => 'Text Area',
            'desc'  => 'Description',
            'id'    => $prefix . 'text2',
            'type'  => 'textarea',
            'cols' => 20,
            'rows' => 3             
        ),
        // CHECKBOX
        array(
            'name' => __( 'Checkbox', 'rwmb' ),
            'id'   => $prefix . 'checkbox',
            'type' => 'checkbox',
            // Value can be 0 or 1
            'std'  => 1,
        )
    )
);

return $meta_boxes;

}

Then to display the options on the front-end in your theme files you can use the helper function, e.g.

echo rwmb_meta( 'rw_text1' ); //echo the contents from the first textarea
echo rwmb_meta( 'rw_text2' ); //echo the contents from the second textarea
echo rwmb_meta( 'rw_checkbox' ); //echo 1 or 0 if the checkbox is checked

These examples are modified from the plugin’s Github repo where the demo file (linked) contains code on using a variety of metabox types, not just textareas and checkboxes.