<?php
$post_format = get_post_format();
$show_archive_category = united_blog_get_option('show_archive_category', true);
$archive_category_color_display = united_blog_get_option('archive_category_color_display', 'display_as_bg');
$archive_category_limit = united_blog_get_option('archive_category_limit', 1);
$archive_post_meta = united_blog_get_option('archive_post_meta');
$archive_post_meta_settings = array(
    'date_format' => united_blog_get_option('archive_posts_date_format', 'format_2'),
    'show_icons' => united_blog_get_option('show_archive_post_meta_icon', true),
);
?>
<?php if (has_post_format(array('gallery', 'video'))) { ?>
    <div class="entry-media">
        <?php get_template_part('template-parts/archive/archive', $post_format); ?>
    </div>
    <?php
} else { ?>
    <?php if (has_post_thumbnail()) : ?>
        <div class="entry-image entry-image-medium">
            <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
                <?php
                the_post_thumbnail(
                    'medium_large',
                    array(
                        'alt' => the_title_attribute(
                            array(
                                'echo' => false,
                            )
                        ),
                    )
                );
                ?>
            </a>
        </div>
    <?php endif; ?>
<?php } ?>

<div class="entry-details">
    <header class="entry-header">
        <?php
        if (get_post_type() === 'post') {
            if (!empty($show_archive_category)) {
                united_blog_post_categories($archive_category_color_display, $archive_category_limit);
            }
        }
        ?>
        <?php the_title('<h2 class="entry-title entry-title-big"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h2>'); ?>
    </header><!-- .entry-header -->

    <?php
    united_blog_post_meta_info($archive_post_meta, $archive_post_meta_settings);
    ?>
</div>
