I a not so good at php. I've purchased conditional mea box. But I am unable to show the meta box data on my theme.
Here is my function.php code:
add_filter( 'rwmb_meta_boxes', 'Brands_and_Products' );
function Brands_and_Products( $meta_boxes )
{
$meta_boxes[] = array(
'id' => 'brand_product',
'title' => 'Brands and Products',
'post_types' => array( 'post', 'page' ),
'context' => 'normal',
'priority' => 'high',
// Conditional Logic can be applied to Meta Box
// In this example: Show this Meta Box by default. Hide it when post format is aside
'hidden' => array( 'post_format', 'aside' ),
'fields' => array(
array(
'id' => 'brand',
'name' => 'Brand',
'desc' => 'Pick Your Favourite Brand',
'type' => 'select',
'options' => array(
'Samsung' => 'Samsung',
'Nokia' => 'Nokia',
'Symphone' => 'Symphone',
'Microsoft' => 'Microsoft',
'HTC' => 'HTC',
'Sony' => 'Sony',
'Huawei' => 'Huawei'
)
),
array(
'id' => 'Samsung_products',
'name' => 'Which Apple product that you love?',
'type' => 'radio',
'options' => array(
'Samsung galaxy S' => 'Samsung galaxy S',
'Samsung pop' => 'Samsung pop',
),
'hidden' => array( 'brand', '!=', 'Samsung' )
),
array(
'id' => 'Nokia_products',
'name' => 'Which Apple product that you love?',
'type' => 'radio',
'options' => array(
'Lumia' => 'Lumia',
'N Series' => 'N Series'
),
'hidden' => array( 'brand', '!=', 'Nokia' )
),
)
);
return $meta_boxes;
}
And here is the echo data on my theme :
<?php echo get_post_meta($post->ID, 'Brands_and_Products', true);?>
Can you help me out ?
Thanks in advance.