Showing Gallery Image From Option Tree

<?php $images = explode( ‘,’, ot_get_option(‘shop_1’) );
if ( ! empty( $images ) ) {
foreach( $images as $id ) {
if ( ! empty( $id ) ) {
$full_img_src = wp_get_attachment_image_src($id, ‘full’);
//print_r($full_img_src);
//$thumb_img_src = wp_get_attachment_image_src( $id);
echo ‘<li><a href=”#”><img src=”‘ . $full_img_src[0] . ‘” alt=”image”></a></li>’;
}
}
}
?>

Advertisements

Published by

oudarya

I am a developer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s