Hey sorry it was a long day yesterday so i didn’t really explain.
so here is my meta box config
////// Custom Meta Boxes //////
/* ********* adding custom metaboxes ***************** */
add_action( 'cmb2_admin_init', 'portfolio_metaboxes' );
/**
* Define the metabox and field configurations.
*/
function portfolio_metaboxes()
{
// Start with an underscore to hide fields from custom fields list
$prefix = '_portfolio_metaboxes';
/**
* Initiate the metabox
*/
$cmb = new_cmb2_box(array(
'id' => 'portfolio_images',
'title' => __('Portfolio Images', 'cmb2'),
'object_types' => array('page'), // Post type
'context' => 'normal',
'priority' => 'default',
'show_names' => true, // Show field names on the left
'cmb_styles' => true, // false to disable the CMB stylesheet
'closed' => false, // Keep the metabox closed by default
'show_on' => array( 'key' => 'page-template', 'value' => 'page-portfolio.php' ), // Specific post IDs to display this metabox
));
/// file list for thumbnails of portfolio item
$cmb->add_field( array(
'name' => __( 'Upload Images for this portfolio page', 'cmb2' ),
'desc' => __( 'upload all the images for this portfolio page', 'cmb2' ),
'id' => $prefix . '_images',
'type' => 'file_list',
'preview_size' => array( 100, 100 ), // Default: array( 50, 50
) );
}
its just a file list to upload images to a page. Then i installed a plugin to add categories to the media attachments. I believe its just using the categories taxonomy. I tried to just add categories my self but my boss wanted to have check boxes in the popup modal for the media so this plugin handled that.
Ok so I have the images upload and some categories check in the pop up modal. I have got the images on to the page using CMB2 example page code for file_list. Now i need to some how get the cat_names that are associated with each image, which could be more then one cat_name, and then add them to a div class. I am doing this so that I can use isotope to filter the divs. Does that make sense. SO how can i use the attachment ID of the images to gather those cat_names. Is that possible?