<!--[archive/header/tag]-->

<?php

    $thumbnail_id = get_term_meta( get_queried_object_id(), "term_thumbnail", true );
    $term_description = term_description( get_queried_object_id() );

    $rkn_meta = get_term_meta( get_queried_object_id(), "rkn_disclaimer", true );

?>
<?php if( $thumbnail_id ): ?>

    <div class="tag">

        <div class="tag__body position-relative">

            <?= wp_get_attachment_image_html($thumbnail_id, false, false, 1200); ?>

            <div class="tag-main">

                <h1 class="tag__body__title">

                    <img loading="lazy" src="/wp-content/themes/profile/assets/img/news/item/subtract.svg" alt="">

                    <?= get_term( get_queried_object_id() )->name ?>

                </h1>

                <?php if ( $term_description ) : ?>

                    <div class="tag__body__text d-none d-md-block">

                        <?= $term_description; ?>

                    </div>

                <?php endif; ?>

            </div>

        </div>

        <?php if ( $term_description ) : ?>

            <div class="container-fluid tag-mobile__text tag__body__text d-md-none">

                <?= $term_description; ?>

            </div>

        <?php endif; ?>

    </div>

<?php else : ?>

    <div class="profile_onenews mb-4">

        <div class="profile_onenews__title h2">

            <svg class="align-baseline svg-icon" width="36" height="37"><use xlink:href="/wp-content/themes/profile/assets/img/sprites-svg/dist/sprite.svg#tag"></use></svg>

            <?= get_term( get_queried_object_id() )->name ?>

        </div>

        <?php if ( $term_description ) : ?>

            <div class="newstag__body__text d-none d-md-block">

                <?= $term_description; ?>

            </div>

        <?php endif; ?>

    </div>

<?php endif; ?>

<?php if($rkn_meta): ?>

    <div class="mt-2 mb-4 col-12">
        <em>
            <?= get_rkn_disclaimer_for_tags($rkn_meta, get_term( get_queried_object_id() )->name); ?>
        </em>
    </div>

<?php endif; ?>


<!--[/archive/header/tag]-->