add files
This commit is contained in:
33
template-parts/post/cell-sticker.php
Normal file
33
template-parts/post/cell-sticker.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<!--[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]-->
|
||||
Reference in New Issue
Block a user