I am using this wordpress plugin to upload multiple images. http://wordpress.org/plugins/upload-multiple-image/
It gives me a function that return an array get_multiple_image($post_id)
. But next I don’t know how to display this array?
I want to display all images in this format.
What I should do to get images path in $img1
, $img2
, $img3
, $img4
.
<img src="<?php echo $img1; ?>" alt="">
<img src="<?php echo $img2; ?>" alt="">
<img src="<?php echo $img3; ?>" alt="">
<img src="<?php echo $img4; ?>" alt="">
if I do this print_r(get_multiple_image($post_id));
it return this
Array ( [0] => http://localhost/arabian/wp-content/uploads/2014/05/flaconi-bag1.png [1] => http://localhost/arabian/wp-content/uploads/2014/05/hoods-products1.png [2] => http://localhost/arabian/wp-content/uploads/2014/05/product-ring1.png [3] => http://localhost/arabian/wp-content/uploads/2014/05/soud-gloves1.png )
Quick and easy:
Or if you want to set an alternative image text derived from the loop index:
try
or for path you can use array index values
and so on….
Try this
The output will be,
and the result
See example
Use this code.