Exemplo n.º 1
0
 function ktz_gallery_slide()
 {
     global $post;
     $meta_values = get_post_custom($post->ID);
     if (isset($meta_values['ktz_gallery_post_postformat'][0]) && has_post_format('gallery')) {
         $title = get_the_title();
         $gallery = explode(',', get_post_meta(get_the_ID(), 'ktz_gallery_post_postformat', true));
         echo '<div class="box_gallery box_gallery_single"><div id="inner_box_gallery">';
         $count = 0;
         foreach ($gallery as $slide) {
             $attachment_url = get_attachment_link($slide);
             $img_url = wp_get_attachment_url($slide);
             $desc_img = get_the_title($slide);
             $params = array('width' => 539);
             $image_ori = bfi_thumb($img_url, $params);
             //resize & crop the image
             if ($count == 0) {
                 echo '<a class="data-original-link" href="' . $attachment_url . '" data-title="Image for ' . $desc_img . '"><img class="data-original" src="' . $image_ori . '" height="auto" width="539" alt="' . $desc_img . '" title="' . $desc_img . '" /></a>';
             }
             $count++;
         }
         echo '</div>';
         echo '<div class="widget_carousel ktz-slidesingle"><div class="list_carousel"><div class="ktzcarousel-little owl-carousel owl-theme owl-little">';
         foreach ($gallery as $slide) {
             $attachment_url = get_attachment_link($slide);
             $img_url = wp_get_attachment_url($slide);
             $desc_img = get_the_title($slide);
             $params_1 = array('width' => 177, 'height' => 130, 'crop' => true);
             $image = bfi_thumb($img_url, $params_1);
             //resize & crop the image
             $params_2 = array('width' => 539);
             $image_ori = bfi_thumb($img_url, $params_2);
             //resize & crop the image
             echo '<div class="item ktz-widgetcolor"><img src="' . $image . '" data-ori="' . $attachment_url . '" data-crop="' . $image_ori . '" height="130" width="177" alt="' . $desc_img . '" data-title="' . $desc_img . '" /></div>';
         }
         echo '</div></div></div></div>';
     } else {
         echo '<div class="ktz-featuredimg">';
         echo ktz_featured_img_width(540);
         echo '</div>';
     }
 }
Exemplo n.º 2
0
ktz_posted_title_h('h2', 'entry-title');
?>
	<div class="meta-post">
		<?php 
hook_ktz_content_meta();
?>
	</div>
	<div class="entry-body media">
	
	<div class="clearfix">
		<?php 
if (has_post_format('gallery')) {
    echo ktz_gallery_slide();
} else {
    echo '<div class="ktz-featuredimg">';
    echo ktz_featured_img_width(540);
    // New kentooz image croping just call ktz_featured_img( width, height )
    echo '</div>';
}
?>
	</div>
	
	<div class="media-body ktz-post">
		<?php 
hook_ktz_content();
?>
	</div>
	
	</div>
	
	<?php