コード例 #1
0
 /**
  * Get Page,Post custom gallery ids
  *
  * @since roen 1.0
  */
 function roen_get_gallery_list($post_id, $thumbs_size, $fancybox_name = 'fancybox-thumb')
 {
     $gallery_images = penguin_get_post_meta_key('gallery-images', $post_id);
     $img_list = roen_get_post_gallery_ids($gallery_images);
     $out_html = '';
     if (count($img_list) > 0) {
         foreach ($img_list as $item_id) {
             $attachment_image = wp_get_attachment_image_src($item_id, $thumbs_size);
             $full_image = wp_get_attachment_image_src($item_id, 'full');
             $out_html .= '<li><a href="' . esc_url($full_image[0]) . '" class="fancybox-thumb" rel="' . $fancybox_name . '[' . $post_id . ']"><img src="' . esc_url($attachment_image[0]) . '" alt=""></a></li>';
         }
     }
     return $out_html;
 }
コード例 #2
0
                    $output .= '<div class="post-element-content">
				<div class="post-img">' . get_the_post_thumbnail(get_the_ID(), $blog_shortcode_thumbnail_size, array('alt' => get_the_title(), 'title' => '')) . '
					<div class="post-tip">
						<div class="btns">
							<a href="' . get_permalink() . '"><i class="fa fa-file-text-o"></i></a>
							<a href="' . esc_url($full_image[0]) . '" class="fancyBox"><i class="fa fa-search-plus"></i></a>
						</div>
                </div>
				</div>
			</div>';
                }
            } else {
                if (get_post_format() == "gallery") {
                    $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), $blog_shortcode_thumbnail_size);
                    $gallery_images = get_post_meta(get_the_ID(), 'gallery-images', true);
                    $img_list = roen_get_post_gallery_ids($gallery_images);
                    $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                    if (count($img_list) > 0) {
                        $output .= '<div class="post-element-content">
				<div class="flexslider roen-fl post-gallery">
					<ul class="slides">';
                        $output .= '<li>
									<a href="' . esc_url($full_image[0]) . '" class="fancybox-thumb" rel="fancybox-thumb[post-code-c1-' . get_the_ID() . ']"><img src="' . esc_url($attachment_image[0]) . '" alt=""></a>
								</li>';
                        foreach ($img_list as $item_id) {
                            $attachment_image = wp_get_attachment_image_src($item_id, $blog_shortcode_thumbnail_size);
                            $full_image = wp_get_attachment_image_src($item_id, 'full');
                            $output .= '<li><a href="' . esc_url($full_image[0]) . '" class="fancybox-thumb" rel="fancybox-thumb[post-code-c1-' . get_the_ID() . ']"><img src="' . esc_url($attachment_image[0]) . '" alt=""></a></li>';
                        }
                        $output .= '		</ul>
				</div>