File: /hosting/kak.bg/web/wp-content/themes/social_play_child/libs/home_posts.php
<?php
global $post;
?>
<?php if ($wp_query->have_posts()) : ?>
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<?php if($post->post_type != 'post') continue;?>
<?php
//Get the category if not set
$category = get_the_category();
//Get first item of array if array
if(is_array($category)){
$category = $category[0];
}
?>
<div class="vid-box large">
<div class="video-thumb">
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'video-large' );
if( ! $thumb && kvalue( $vids, 'thumb') ) $thumb[0] = kvalue( $vids, 'thumb');
elseif( !$thumb ) $thumb[0] = get_template_directory_uri().'/images/video-large.gif';
$thumb = current( (array) $thumb);
$img_size = ( $class == 'small' ) ? array('width'=>256, 'height'=>160) : array('width'=>556, 'height'=>315); ?>
<img <?php echo http_build_query($img_size, '', ' ');?> class="thumb" src="<?php echo $thumb;?>" alt="<?php the_title(); ?>">
<div class="thumb-info">
<div class="info">
<a href="<?php echo get_category_link($category->cat_ID);?>" title="<?php echo $category->name;?>">
<?php echo $category->name;?>
</a>
</div>
<div class="video-controls" data-id="<?php the_ID(); ?>">
<span>Автор <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></span><br/>
<!--<div style="width:100%; text-align:center"><?php //echo get_avatar(get_the_author_meta( 'ID' )); ?></div>-->
</div>
</div>
<a class="thumb-hover" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<span>
<span><?php the_title(); ?></span>
</span>
</a>
</div>
<!-- video-thumb ends -->
</div>
<?php $count = ( $count > 4 ) ? 0 : $count + 1;?>
<?php endwhile;?>
<?php endif;?>