Custom Fields
Re-Envisioned
Support General Change single image size

  • Creator
    Topic
  • #31457
    Resolved Rebecca Robertson
    Participant

    How do I add width and height to this bit of code:

    
    <?php 
    $image = rwmb_meta( 'state_featured_image', ['object_type' => 'term'], $state->term_id );
    echo '<img src='. $image['url'] .' />';
    ?>
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #31461
    Long Nguyen
    Moderator

    Hi Rebecca,

    You can add the size setting to the second parameter of the helper shortcode.

    $image = rwmb_meta( 'state_featured_image', ['object_type' => 'term', 'size' => 'large'], $state->term_id );

    Please read more here https://docs.metabox.io/fields/single-image/#template-usage

    #31462
    Rebecca Robertson
    Participant

    Thank you!

    The documentation wasn't helping much, I tried putting the size everywhere I could think of. I finally ended up using the code from the adding images to categories.

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