Trying to use php to add advanced img from group field

Support MB Group Trying to use php to add advanced img from group field

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30237
    jimimacjimimac
    Participant

    I've been trying to use this code from the docs...

    $images = rwmb_meta( 'info', array( 'size' => 'thumbnail' ) );
    foreach ( $images as $image ) {
        echo '<a href="', $image['full_url'], '"><img src="', $image['url'], '"></a>';
    }

    Does the 'info' part mean the field ID? I've tried it that way and I cant make the image appear.

    so my custom field group field has an ID of "blurb_1". Inside this is an advanced image field with the ID of "blurb_1_image".

    #30246
    Long NguyenLong Nguyen
    Moderator

    Hi Jimimac,

    Please follow this documentation to know how to show the image in a group https://docs.metabox.io/extensions/meta-box-group/#sub-field-values

    #30288
    jimimacjimimac
    Participant

    Im getting a 500 error now.

    Where do i find the "image_key'?

    #30301
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The image_key is the field ID. It might be blurb_1_image in your case. You can share the code that creates the fields, I can help you to review your code.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.