Files
profile/template-parts/post/cell-sticker.php
Andrey Kuvshinov 8fc8cbae32 add files
2025-07-09 21:21:17 +03:00

33 lines
676 B
PHP

<!--[post/cell-sticker]-->
<?php
$term_id = get_current_page_main_taxonomy_term_id( get_the_ID() );
$color = get_term_meta( $term_id, "color", true );
$color = $color ? $color : "grey";
?>
<span class="sticker-group">
<?php if( in_array( get_post_type(), ["anew", "yellow"] ) ): ?>
<a class="sticker sticker--white" href="/news">НОВОСТИ</a>
<?php endif; ?>
<?php if( $term_id ) : ?>
<a class="sticker sticker--<?= $color ?>" href="<?= get_term_link( $term_id ) ?>">
<?= get_term( $term_id )->name; ?>
</a>
<?php endif; ?>
</span>
<!--[/post/cell-sticker]-->