WordPress.org

Forums

Types
Can't display image in a template (2 posts)

  1. dashaluna
    Member
    Posted 3 years ago #

    Hello,

    I've created an image field with the plugin and now I'm confused how to display that image in a template I've tried the following without much success:

    $img = types_render_field("wpcf-people_photo", array("alt"=> "Profile image",
                        "size" => "image-custom-size-name"));
    echo $img;

    This doesn't do anything. I would really appreciate if you could give an example of how to display an image of a registered image size.

    Many thanks,
    Dasha

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

  2. AmirHelzer
    Member
    Plugin Author

    Posted 3 years ago #

    Here's the API page that explains about arguments for the image field:
    http://wp-types.com/documentation/functions/#Image

    The function types_render_field already echos. You shouldn't echo additionally.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic