Just purchased the Include/Exclude plugin and did the following:
1. Removed the original metabox plugin
2. Installed the Include Exclude plugin
3. In theme's function.php I have the following code segment.
4. When I go to Add New Page and select one of the page templates (Basic or Basic with Hero) which are supposed to include the custom fields, nothing happens.
Please help.
===== code in functions.php ===
add_filter( 'rwmb_meta_boxes', 'evoknow_register_meta_boxes' );
function evoknow_register_meta_boxes( $meta_boxes )
{
$prefix = 'rw_';
// 1st meta box
$meta_boxes[] = array(
'id' => 'personal',
'title' => 'Hero Template Specific Custom Fields',
'pages' => array( 'post', 'page' ),
'context' => 'normal',
'priority' => 'high',
'include' => array(
// With all conditions below, use this logical operator to combine them. Default is 'OR'. Case insensitive. Optional.
'relation' => 'OR',
// List of page templates. Can be array or comma separated. Optional.
'template' => array( 'page-basic.php', 'page-basic_hero.php' ),
),
'fields' => array(
array(
'name' => 'Hero Title',
'desc' => 'Format: 200 characters or less',
'id' => $prefix . 'hero_title',
'type' => 'text',
'std' => 'Enter a title',
'class' => 'custom-class',
'clone' => false,
),
array(
'name' => 'Hero Banner',
'id' => $prefix . 'hero_banner',
'type' => 'file_advanced',
'std' => 'Upload a banner',
'class' => 'custom-class',
'clone' => false,
),
)
);
// 2nd meta box
$meta_boxes[] = array(
'title' => 'Media',
'pages' => array( 'movie', 'slider' ),
'fields' => array(
array(
'name' => 'URL',
'id' => $prefix . 'url',
'type' => 'text',
),
)
);
return $meta_boxes;
}