How to display an image in frontend with link for full size?

Support General How to display an image in frontend with link for full size?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10001
    EddyPiVEddyPiV
    Participant

    Hi,

    I allow by members of my website to update their profile through Frontend Submission.
    They can include up to 3 images.
    I am using the shortcode [rwmb_meta meta_key="field-id"][/rwmb_meta] to display the fields to the visitors in frontend.

    How can I show these images to the visitors in frontend in thumbnail + a link to show full size?

    Thanks.

    #10025
    Anh TranAnh Tran
    Keymaster

    Hi,

    To display the images in thumbnail with links to the full-size, please use this shortcode:

    [rwmb_meta meta_key="field-id" link="true" size="thumbnail"]

    You can also use code snippet, if you don't want to use shortcode:

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

    For more info, please check out the docs.

    #10045
    EddyPiVEddyPiV
    Participant

    Aha, that works great. Thanks!

    I missed the possibility to use such parameters in the shortcode. Still learning...
    Issue can be closed.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘How to display an image in frontend with link for full size?’ is closed to new replies.