<?php

/**
 * Blog Content Template
 *
 * @package    WordPress
 * @subpackage ROONIX
 * @author     themexriver
 * @version    1.0
 */

if (class_exists('Roonix_Resizer')) {
    $img_obj = new Roonix_Resizer();
} else {
    $img_obj = array();
}
$options = roonix_WSH()->option();
$allowed_tags = wp_kses_allowed_html('post');

global $post;
$post_thumbnail_id = get_post_thumbnail_id($post->ID);
$post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id);

?>

<div <?php post_class(); ?>>

	<?php
        $format = get_post_format(get_the_id());
        if ($format == 'video') :
    ?>
    
    <!-- News Block Six -->
    <div class="news-block-six">
        <div class="inner-box">
            <?php if( has_post_thumbnail() ):?>
            <div class="image">
                <?php the_post_thumbnail('full'); ?>
                <a href="<?php echo (get_post_meta(get_the_id(), 'video_link', true)); ?>" class="video-icon overlay-box" data-rel="lightcase:myCollection"><span class="flaticon-media-play-symbol transition-900ms"><i class="ripple"></i></span></a>
            </div>
            <?php endif;?>
            <div class="lower-content">
                <ul class="post-meta">
                    <li><span class="flaticon-calendar"></span> <?php echo wp_kses( get_the_date(), true ); ?></li>
                    <li><span class="flaticon-user-3"></span> <?php the_author(); ?></li>
                    <li><span class="flaticon-bubble-chat"></span> <?php comments_number( wp_kses(__('0 Comments' , 'roonix'), true), wp_kses(__('1 Comment' , 'roonix'), true), wp_kses(__('% Comments' , 'roonix'), true)); ?></li>
                </ul>
                <h3><a href="<?php echo esc_url( the_permalink( get_the_id() ) );?>"><?php the_title(); ?></a></h3>
                <div class="text"><?php the_excerpt(); ?></div>
                <a class="read-more" href="<?php echo esc_url( the_permalink( get_the_id() ) );?>"><?php esc_html_e('Read More', 'roonix'); ?></a>
            </div>
        </div>
    </div>
    
    
    <?php elseif ($format == 'gallery') : ?>
    
    <!-- News Block Six -->
    <div class="news-block-six">
        <div class="inner-box">
            <div class="single-item-carousel owl-carousel owl-theme">
                <?php $gall_images = (get_post_meta(get_the_id(), 'gallery_imgs', true));
                    $gall_images = explode(',', $gall_images);
                    if ($gall_images) :
                    foreach ($gall_images as $gall) :
                ?>
                <div class="image">
                    <?php echo wp_get_attachment_image($gall, 'roonix_1170x410');  ?>
                </div>
                <?php endforeach; endif; ?>
            </div>
            <div class="lower-content">
                <ul class="post-meta">
                    <li><span class="flaticon-calendar"></span> <?php echo wp_kses( get_the_date(), true ); ?></li>
                    <li><span class="flaticon-user-3"></span> <?php the_author(); ?></li>
                    <li><span class="flaticon-bubble-chat"></span> <?php comments_number( wp_kses(__('0 Comments' , 'roonix'), true), wp_kses(__('1 Comment' , 'roonix'), true), wp_kses(__('% Comments' , 'roonix'), true)); ?></li>
                </ul>
                <h3><a href="<?php echo esc_url( the_permalink( get_the_id() ) );?>"><?php the_title(); ?></a></h3>
                <div class="text"><?php the_excerpt(); ?></div>
                <a class="read-more" href="<?php echo esc_url( the_permalink( get_the_id() ) );?>"><?php esc_html_e('Read More', 'roonix'); ?></a>
            </div>
        </div>
    </div>
    
    
    <?php elseif ($format == 'quote') : ?>
    
    <!-- News Block Five -->
    <div class="news-block-five">
        <div class="inner-box">
            <ul class="post-meta">
                <li><span class="flaticon-calendar"></span> <?php echo wp_kses( get_the_date(), true ); ?></li>
                <li><span class="flaticon-user-3"></span> <?php the_author(); ?></li>
                <li><span class="flaticon-bubble-chat"></span> <?php comments_number( wp_kses(__('0 Comments' , 'roonix'), true), wp_kses(__('1 Comment' , 'roonix'), true), wp_kses(__('% Comments' , 'roonix'), true)); ?></li>
            </ul>
            <h3><a href="<?php echo esc_url( the_permalink( get_the_id() ) );?>"><?php the_title(); ?></a></h3>
            <div class="text"><?php the_excerpt(); ?></div>
            <a class="read-more" href="<?php echo esc_url( the_permalink( get_the_id() ) );?>"><?php esc_html_e('Read More', 'roonix'); ?></a>
        </div>
    </div>
    
    
    <?php else: ?>
        
    <!-- News Block Six -->
    <div class="news-block-six">
        <div class="inner-box">
            <?php if (has_post_thumbnail()){ ?>
            <div class="image">
                <a href="<?php echo esc_url( the_permalink( get_the_id() ) );?>"><?php the_post_thumbnail('full'); ?></a>
            </div>
            <?php } ?>
            <div class="lower-content">
                <ul class="post-meta">
                    <li><span class="flaticon-calendar"></span> <?php echo wp_kses( get_the_date(), true ); ?></li>
                    <li><span class="flaticon-user-3"></span> <?php the_author(); ?></li>
                    <li><span class="flaticon-bubble-chat"></span> <?php comments_number( wp_kses(__('0 Comments' , 'roonix'), true), wp_kses(__('1 Comment' , 'roonix'), true), wp_kses(__('% Comments' , 'roonix'), true)); ?></li>
                </ul>
                <h3><a href="<?php echo esc_url( the_permalink( get_the_id() ) );?>"><?php the_title(); ?></a></h3>
                <div class="text"><?php the_excerpt(); ?></div>
                <a class="read-more" href="<?php echo esc_url( the_permalink( get_the_id() ) );?>"><?php esc_html_e('Read More', 'roonix'); ?></a>
            </div>
        </div>
    </div>
    
    <?php endif; ?>

</div>