function.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
/** * Галерея */ function imageArr ($post_id) { global $post; $defImg = get_gallery_images($post_id); $imageArr = array(); $per = get_post_gallery($post_id, false ); $perExlode = explode(",", $per['ids']); foreach ($perExlode as $key => $value) { $imageArr[$value] = $defImg[$key]; } if(count($imageArr)>1) { $result .='<div class="bx-galery" >'; foreach ($imageArr as $imgTitle => $imgSrc) { $imgTitle = get_the_title($imgTitle); $imagefull = $imgSrc; $image = aq_resize( $imgSrc, 200, 150, true ); //resize & crop img 140x100 $result .= "<div><a href='".$imagefull."' rel='lightbox' title='".$imgTitle."'><img src='".$image."' /></a></div>"; } $result .= "</div>"; return $result; } } |