Support » Plugin: Meta Box - WordPress Custom Fields Framework » Display images with size

  • Resolved krysttof

    (@krysttof)



    I can’t use the size argument to display image.
    Here is my code :

    $my_images = rwmb_meta(rw_image,'size=300px');
    foreach ( $my_images as $image ) {
       echo '<p><img src="'.$image['full_url'].'" /></p>';
     }

    What’s wrong ?
    Thank you for your help.
    Sorry for my bad english ! 😉

    https://wordpress.org/plugins/meta-box/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Tran Ngoc Tuan Anh

    (@rilwis)

    The size attribute is the image size your theme registers with WordPress using the register_image_size() function or the default WP sizes (thumbnail, medium, large). It’s NOT the size in pixels.

    So, you should the change the code to this:

    $my_images = rwmb_meta(rw_image,’size=medium’);
    foreach ( $my_images as $image ) {
    echo ‘<p><img src=”‘.$image[‘full_url’].'” /></p>’;
    }

    OK ! Thank’s for your quick reply !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display images with size’ is closed to new replies.