Description
Returns an image preview of the specified field (By given metaKey).
Parameters
1 2 3 4 5 |
<?php get_image($metaKey,$groupIndex=1,$fieldIndex=1,$parameter=array(),$attr=array(),$post_id=null); ?> |
- $metaKey: The Meta key of the field . eg “book_author” (required)
- $groupIndex:Specific group index if you have duplicate group. Defaults to 1(not required)
- $fieldIndex:Specific field index if you have duplicate group. Defaults to 1(not required)
- $parameter:$parameter is the image thumbnail proprety ==== > width,height,crop(true/false).(not required)
- $attr:$attr image Attribute Property ==> id,class,style,rel,extra(you can put other properties)(not required)
- $post_id: Specific post ID where your value was entered. Defaults to current post ID(not required)
Usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?php $image = get_image(artiest,1,1,array('width'=>100,'height'=>100,true),array('id'=>'img','class'=>'art-img'),405); // By using All parameter $image = get_image(artiest,1,1,array('width'=>100,'height'=>100,true)); // using $metakey, $groupindex, $fieldIndex, $parameter, $attr $image = get_image(artiest,1,1); // using $metakey, $groupindex, $fieldIndex if($image){ echo $image; } else{ // do something } ?> |
Leave a Reply
You must be logged in to post a comment.