I have added custom cmb2 meta box on my WordPress theme. I want to make 2 columns on my backend admin panel. How could I do it.?? Its screenshot of my admin panel. Please check code of cmb2 from below

    add_action('cmb2_admin_init', 'custom_meta_post');

    function custom_meta_post(){ 

$slider = new_cmb2_box(array(
            'title'         => __('SLIDER FIELD AREA', 'comet'),
            'id'            => 'slider',
            'object_types'  => array('comet-slider')
        ));

        $left_field = $slider->add_field(array(
            'name' => 'Subtitle',
            'id' => '_slider-subtitle',
            'type' => 'text',
        ));
        $left_field = $slider->add_field(array(
            'name'  => 'Left Button Text',
            'id'    => 'left-button',
            'type'  => 'text'
        ));
        $left_field = $slider->add_field(array(
            'name'  => 'Left Button Url',
            'id'    => 'left-button-url',
            'type'  => 'text'
        ));
        $left_field = $slider->add_field(array(
            'name'      => 'Left Button Type',
            'id'        => 'left-button-type',
            'type'      => 'select',
            'options'   => array(
                'red'           => 'Red Button',
                'transparent'   => 'Transparent Button',
            ),
        ));


        $right_field = $slider->add_field(array(
            'name'  => 'Right Button Text',
            'id'    => 'right-button',
            'type'  => 'text'
        ));
        $right_field = $slider->add_field(array(
            'name'  => 'Right Button Url',
            'id'    => 'right-button-url',
            'type'  => 'text'
        ));
        $right_field = $slider->add_field(array(
            'name'      => 'Right Button Type',
            'id'        => 'right-button-type',
            'type'      => 'select',
            'options'   => array(
                'red'           => 'Red Button',
                'transparent'   => 'Transparent Button',
            ),
        ));
    }

Read more here: How will I make two column field by cmb2


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: