<?php
    $post = get_theme_mod('crt_manage_hero_v1_center_post');
    $ratio = get_theme_mod('crt_manage_hero_v1_thumbnail_size', 'ratio169');
    $attr_align = get_theme_mod('crt_manage_general_post_item_align', 'text-left');
    $attr_ratio = get_theme_mod('crt_manage_general_post_item_ratio', 'ratio57');
    $slider_fullwidth = get_theme_mod('crt_manage_enable_hero_v1_slider_full_width', true);
?>
<?php if(!empty($post)): ?>
    <?php foreach ( $post as $post_id ) :
        $post = get_post( $post_id );
        $get_permalink = get_permalink( $post );
        if($slider_fullwidth) {
            $get_thumbnail_url = get_the_post_thumbnail_url( $post_id, 'mushava-magazine-blog-image-large');
        } else {
            $get_thumbnail_url = get_the_post_thumbnail_url( $post_id, 'mushava-magazine-blog-image-medium');
        }
        ?>
        <div class="hero__item">
            <div class="hero__item--inner position-relative <?php echo esc_attr($attr_align); ?>">
                <a href="<?php echo esc_attr($get_permalink); ?>">
                    <img class="thumbnail <?php echo esc_attr($attr_ratio); ?>" data-lazy="<?php echo esc_attr($get_thumbnail_url); ?>" alt="<?php echo esc_attr($post->post_title); ?>" />
                </a>
                <div class="hero__content">
                    <h3 class="hero__title mt-3 mb-2"><a href="<?php echo esc_attr($get_permalink); ?>"><?php echo esc_html($post->post_title); ?></a></h3>
                    <div class="entry__author">
                        <?php mushava_magazine_blog_entry_options($post, array('class' => 'mt-0', 'entry_date' => false, 'entry_cat' => true, 'entry_author' => true, 'entry_read_time' => false, 'entry_comment' => false, 'entry_view_count' => false, 'entry_date_order' => 1, 'entry_cat_order' => 2, 'entry_author_order' => 3, 'entry_read_time_order' => 4, 'entry_comment_order' => 5, 'entry_view_count_order' => 6)); ?>
                    </div>
                </div>
            </div>
        </div>
    <?php endforeach;  ?>
<?php endif; ?>
