I'm trying to add a meta box into a custom post type and display the text on the front end.

I made a meta box as follows:

    'name'   => __( '<b>Schema</b>', 'themeum-soccer'),
    'id'     => 'schema_group',
    'type'   => 'group',
    'fields' => array(
            'name' => __('schema', 'themeum-soccer'),
            'id'   => 'schema_knvb',
            'desc' => __('Paste hier de php snippit', 'themeum-soccer' ),
            'type' => 'textarea',
            'std'  => '',
            'name' => __( 'Naam Trainer', 'themeum-soccer' ),
            'id'   => "test123",
            'desc' => __( 'Naam Trainer(ex: Arno Kuppen)', 'themeum-soccer' ),
            'type' => 'text',
            'std'  => '',

That is now saved in the plugin I'm working in, but when I put the following code in my custom post template:

<div role="tabpanel" class= "tab-pane fade" id="schema">
        <?php echo rwmb_meta( $schema_knvb ); ?>

Why does it only print "Array" (see image below)?

enter image description here

1 Answer 1


Use this code

$schema_group = rwmb_meta( 'schema_group' );
$schema_knvb = isset( $schema_group['schema_knvb'] ) ? $schema_group['schema_knvb'] : '';
echo $schema_knvb;

for more detail check the "Meta Box Group" page on the plugin documentation https://metabox.io/docs/meta-box-group/#section-how-to-get-meta-value-of-a-sub-field

  • Happy to help. If this answer solved your issue, please do not forget mark it as accepted ; )
    – Nico
    Commented Nov 8, 2015 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.