WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
[resolved] Get other sizes of custom image-fields (3 posts)

  1. Jules Colle
    Member
    Posted 1 year ago #

    Hello, I really like your plugin, it has helped me a lot. But I have one small problem.

    Say I have a repeating image field. I can loop trough the images like so:

    foreach ($meta['wpcf-myimages'] as $url) {
        echo "<img src=\"$url\">";
    }

    I'm also aware that, if I had only one image field I could do something like this to get the medium sized image:

    echo(types_render_field( "myimage", array( "size" => "medium" ) ));

    But I'm not sure how I can get the medium image size for my repeating images.

    Thanks,
    Jules

    http://wordpress.org/extend/plugins/types/

  2. mbigul
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jules,

    You can use echo(types_render_field( "myimage", array( "size" => "medium" ) )); for showing repeating images in Medium size. Please try and let me know your feedback.

    [ Signature moderated. ]

  3. Jules Colle
    Member
    Posted 1 year ago #

    thank you Bigul, I actually just figured that out. I didn't think it would work, because the function name is a bit misleading being singular and all. But after giving it a try i found it automatically repeats for all fields, and you can even separate the results with a custom delimiter. I'm liking this plugin more and more every time I use it. Resolved!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic