<?php
/**
 * Posts Multislider Template 3
 *
 * This template can be overridden by copying it to mytheme/addons-for-elementor/addons/posts-multislider/style-3.php
 *
 */

if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly
}

$taxonomies = array($settings['taxonomy_chosen']);

$post_id = get_the_ID();

?>

<div class="tfl-posts-multislider-item tfl-<?php echo $settings['bottom_text_alignment']; ?>">

    <article id="post-<?php echo get_the_ID(); ?>"
             class="tfl-post-entry <?php echo join(' ', get_post_class('', $post_id)); ?>">

        <?php if ($thumbnail_exists = has_post_thumbnail() && $settings['display_thumbnail'] == 'yes'): ?>

            <?php $image_setting = ['id' => get_post_thumbnail_id()]; ?>

            <?php $image_src = get_the_post_thumbnail_url($post_id, $settings['thumbnail_size']); ?>

            <?php if ($settings['image_linkable'] == 'yes'): ?>

                <a class="tfl-post-link"
                   href="<?php echo get_the_permalink(); ?>"
                   target="<?php echo $target; ?>">
                    <div class="tfl-post-overlay tfl-post-featured-img-bg"
                         style="background-image: url(<?php echo $image_src; ?>); height: <?php echo $image_height; ?>px;"></div>
                </a>

            <?php else: ?>
                <div class="tfl-post-overlay tfl-post-featured-img-bg"
                     style="background-image: url(<?php echo $image_src; ?>); height: <?php echo $image_height; ?>px;"></div>
            <?php endif; ?>

            <?php if (($settings['display_title'] == 'yes') || ($settings['display_taxonomy'] == 'yes') || ($settings['display_summary'] == 'yes')): ?>

                <div class="tfl-post-text-wrap tfl-bottom-entry-text">

                    <div class="tfl-post-text">

                        <?php if ($settings['display_taxonomy'] == 'yes'): ?>

                            <?php tfl_get_template_part('post-meta/taxonomy-info', array('taxonomies' => $taxonomies)); ?>

                        <?php endif; ?>

                        <?php if ($settings['display_title'] == 'yes'): ?>

                            <?php tfl_get_template_part('post-content/entry-title', array('target' => $target, 'title_tag' => $settings['entry_title_tag'])); ?>

                        <?php endif; ?>

                        <?php if (($settings['display_post_date'] == 'yes') || ($settings['display_author'] == 'yes') || ($settings['display_taxonomy'] == 'yes')) : ?>

                            <div class="tfl-post-meta">

                                <?php if ($settings['display_author'] == 'yes'): ?>

                                    <?php tfl_get_template_part('post-meta/author'); ?>

                                <?php endif; ?>

                                <?php if ($settings['display_post_date'] == 'yes') : ?>

                                    <?php tfl_get_template_part('post-meta/published'); ?>

                                <?php endif; ?>

                                <?php if ($settings['display_comments'] == 'yes') : ?>

                                    <?php tfl_get_template_part('post-meta/comments-number'); ?>

                                <?php endif; ?>

                            </div>

                        <?php endif; ?>

                        <div class="tfl-post-content">

                            <?php if ($settings['display_summary'] == 'yes') : ?>

                                <?php tfl_get_template_part('post-content/entry-summary'); ?>

                            <?php endif; ?>

                            <?php if ($settings['display_read_more'] == 'yes') : ?>

                                <?php $read_more_text = $settings['read_more_text']; ?>

                                <?php tfl_get_template_part('post-content/read-more-link', array('target' => $target, 'read_more_text' => $read_more_text)); ?>

                            <?php endif; ?>

                        </div>

                    </div><!-- .tfl-post-text -->

                </div>

            <?php endif; ?>

        <?php endif; ?>

    </article><!-- .hentry -->

</div><!-- .tfl-posts-multislider-item -->


