1 || !isset($post_taxonomy_tmp[1]))
$post_type = $post_taxonomy_tmp[0];
if( $post_type == 'post'){
$atts['post_type'] = 'post';
$atts['taxonomy'] = 'category';
$atts['amount'] = $atts['items'];
$atts['tax_term'] = str_replace( array('post:','post'), array('',''), $tax_term);
$list_posts = kc_tools::get_posts( $atts );
}else{
foreach( $post_taxonomy_data as $post_taxonomy ){
$post_taxonomy_tmp = explode( ':', $post_taxonomy );
if( isset($post_taxonomy_tmp[1]) ){
$taxonomy_term[] = $post_taxonomy_tmp[1];
}
}
$taxonomy_objects = get_object_taxonomies( $post_type, 'objects' );
$taxonomy = key( $taxonomy_objects );
if( $atts['items'] == 0 ){
$atts['items'] = -1;
}
$args = array(
'post_type' => $post_type,
'posts_per_page' => $atts['items'],
'order' => $atts['order'],
);
if( count($taxonomy_term) )
{
$tax_query = array(
'relation' => 'OR'
);
foreach( $taxonomy_term as $term ){
$tax_query[] = array(
'taxonomy' => $taxonomy,
'field' => 'slug',
'terms' => $term,
);
}
$args['tax_query'] = $tax_query;
}
$the_query = new WP_Query( $args );
$list_posts = $the_query->posts;
}
}
$css_class = apply_filters( 'kc-el-class', $atts );
//fix from version 2.6.10
if( !isset( $atts['show_author'] )) $atts['show_author'] = 'yes';
if( !isset( $atts['show_category'] )) $atts['show_category'] = 'yes';
$meta_data = ($atts['show_date'] == 'yes' || $atts['show_author'] == 'yes' || $atts['show_category'] == 'yes')? 'yes' : 'no';
$css_class[] = 'kc-blog-posts kc-blog-posts-' . $layout;
if ( !empty( $custom_class ) )
$css_class[] = $custom_class;
switch ( $layout ) {
case '1':
$css_class[] = 'owl-carousel';
$data_owl = ' data-owl-options=\'{"autoplay": "yes", "pagination": "yes", "items": "1", "tablet":1, "mobile":1}\'';
break;
case '3':
$css_class[] = 'kc-blog-grid kc_blog_masonry';
break;
case '4':
$css_class[] = 'owl-carousel';
$data_owl = ' data-owl-options=\'{"autoplay": "yes", "pagination": "yes", "items": "3", "tablet":3, "mobile":1}\'';
break;
default:
break;
}
$css_class[] = 'kc-image-align-' . $image_align;
?>
>
post_content = $item->post_content;
if ( has_post_thumbnail( $item->ID ) ) {
$image_id = get_post_thumbnail_id( $item->ID );
$image_size = ! empty( $image_size ) ? $image_size : '543x304xct';
if ( in_array( $image_size, $size_array ) ) {
$image_data = wp_get_attachment_image_src( $image_id, $image_size );
$img_url = $image_data[0];
} else {
$image_full_width = wp_get_attachment_image_src( $image_id, 'full' );
$img_url = kc_tools::createImageSize( $image_full_width[0], $image_size );
}
}else{
if( $force_image == 'yes'){
$img = kc_first_image( $item->post_content );
if( $img != false ) $img_url = $img;
}
}
if($image_align == 'left')
$i=1;
?>
0 ): ?>
post_content, $words ); ?>
0 ): ?>
post_content, $words ); ?>
ID, 'kc_data', true);
if (isset($meta['mode']) && $meta['mode'] == 'kc')
$post_content = $post->post_content = apply_filters('the_content', $post->post_content );
else
$post_content = $post->post_content;
$img_url = '';
if ( has_post_thumbnail( $post->ID ) ) {
$image_id = get_post_thumbnail_id( $post->ID );
$image_size = ! empty( $image_size ) ? $image_size : 'full';
if ( in_array( $image_size, $size_array ) ) {
$image_data = wp_get_attachment_image_src( $image_id, $image_size );
$img_url = $image_data[0];
} else {
$image_full_width = wp_get_attachment_image_src( $image_id, 'full' );
$image_full = $image_full_width[0];
$img_url = kc_tools::createImageSize( $image_full, $image_size );
}
}else{
if( $force_image == 'yes'){
$img = kc_first_image( $post->post_content );
if( $img != false ) $img_url = $img;
}
}
?>
ID, 'kc_data', true);
if (isset($mode['mode']) && $meta['mode'] == 'kc')
$item->post_content = apply_filters('the_content', $item->post_content );
else
$item->post_content = $item->post_content;
$img_url = '';
if ( has_post_thumbnail( $item->ID ) ) {
$image_id = get_post_thumbnail_id( $item->ID );
$image_size = ! empty( $image_size ) ? $image_size : '500x500xct';
if ( in_array( $image_size, $size_array ) ) {
$image_data = wp_get_attachment_image_src( $image_id, $image_size );
$img_url = $image_data[0];
} else {
$image_full_width = wp_get_attachment_image_src( $image_id, 'full' );
$img_url = kc_tools::createImageSize( $image_full_width[0], $image_size );
}
}else{
if( $force_image == 'yes'){
$img = kc_first_image( $item->post_content );
if( $img != false ) $img_url = $img;
}
}
?>
post_content = apply_filters('the_content', $item->post_content );
$img_url = '';
if( has_post_thumbnail( $item->ID ) ){
$image_id = get_post_thumbnail_id( $item->ID );
$image_size = !empty( $image_size ) ? $image_size : '1140x550xct';
if( in_array( $image_size, $size_array ) ){
$image_data = wp_get_attachment_image_src( $image_id, $image_size );
$img_url = $image_data[0];
}else{
$image_full_width = wp_get_attachment_image_src( $image_id, 'full' );
$img_url = kc_tools::createImageSize( $image_full_width[0], $image_size );
}
}else{
if( $force_image == 'yes'){
$img = kc_first_image( $item->post_content );
if( $img != false ) $img_url = $img;
}
}
?>