I never used Admin_init to register the metaboxes.. still it stopped working for me.. i followed the instructions, but no luck so far..
add_filter( 'rwmb_meta_boxes', 'rw_register_meta_boxes' );
function rw_register_meta_boxes( $meta_boxes ){
$prefix = 'rw_';
//THE VARIANTER IMAGES
$meta_boxes[] = array(
'title' => 'Varianter',
'pages' => array( 'product'),
'fields' => array(
array(
'name' => 'Varianter',
'id' => $prefix . 'variant',
'type' => 'file_advanced',
),
)
);
//THE MANUFACTURER INFO
$meta_boxes[] = array(
'title' => 'Inspiration egenskaber',
'pages' => array( 'inspiration'),
'fields' => array(
array(
'name' => 'Inspirations billeder',
'id' => $prefix . 'inspirationbilleder',
'type' => 'file_advanced',
),
)
);
return $meta_boxes;
}
And my code in the template:
<?php if (rwmb_meta( 'rw_variant' ) !== '') { ?>
<label>Udvalg af farver og varianter</label>
<div class="flexslider varianter">
<ul class="slides">
<?php
$images = rwmb_meta( 'rw_variant', 'type=image&size=thumbnail' );
foreach ( $images as $image )
{
echo "<li><a href='{$image['full_url']}' title='{$image['title']}' target='_blank' class='zoom' data-rel='prettyPhoto[product-gallery1]'><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>";
}
?>
</ul>
</div>
<script>
jQuery(window).load(function() {
jQuery('.flexslider.varianter').flexslider({
animation: "slide",
animationLoop: true,
itemWidth: 80,
itemMargin: 50,
minItems: 1,
maxItems: 5,
directionNav: true
});
});
</script>
<?php } ?>
No luck…