Meta-box Wordpress plugin function does not return image with size set

Asked

Viewed 26 times

1

I installed in Wordpress the plugin Metabox and added the field Image Advanced, in the file Function.php added to the following a custom thumbnails with this setting.

add_image_size( 'destaque-pesquisa', 120, 90, true );

On the page I want the image to appear I entered the following code.

<?php 
$images = rwmb_meta('image_advanced_2','type=image&size=destaque-pesquisa'); ?>
<?php if (!empty( $images )){ ?>
<?php foreach ( $images as $image ){?>

<img src='<?php echo $image['url']; ?>'  alt='<?php echo $image['alt']; ?>' >
<?php }} ?>

The image appears on the bad page without the pre-defined dimension in destaque-pesquisa

In the documentation of the plugin Meta-box informs:

$images = rwmb_meta( 'gallery', 'size=YOURSIZE' );
// Ou
$images = rwmb_meta( 'gallery', 'type=image&size=YOURSIZE' );
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.