add files
This commit is contained in:
22
template-parts/post/blog-author.php
Normal file
22
template-parts/post/blog-author.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<!--[post/blog-author]-->
|
||||
|
||||
<?php
|
||||
|
||||
$authors = get_coauthors();
|
||||
|
||||
?>
|
||||
|
||||
<?php foreach ( $authors as $author ): ?>
|
||||
|
||||
<a class="blog__author" href="<?= get_author_posts_url( $author->ID, $author->user_nicename ); ?>" itemprop="author" itemscope itemtype="https://schema.org/Person">
|
||||
|
||||
<?= $author->display_name; ?>
|
||||
|
||||
<meta itemprop="name" content="<?= htmlspecialchars($author->display_name); ?>" />
|
||||
<link itemprop="url" href="<?= get_author_posts_url( $author->ID, $author->user_nicename ); ?>" />
|
||||
|
||||
</a>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<!--[/post/blog-author]-->
|
||||
9
template-parts/post/blog-date.php
Normal file
9
template-parts/post/blog-date.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<!--[post/blog-date]-->
|
||||
|
||||
<time datetime="<?= get_the_date( "d.m.Y H:i:s" ) ?>" class="blog__data">
|
||||
|
||||
<?= get_the_date( "d.m.Y" ) ?>
|
||||
|
||||
</time>
|
||||
|
||||
<!--[/post/blog-date]-->
|
||||
25
template-parts/post/cell-author.php
Normal file
25
template-parts/post/cell-author.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<!--[post/cell-author]-->
|
||||
|
||||
<?php
|
||||
|
||||
$authors = get_coauthors();
|
||||
|
||||
?>
|
||||
|
||||
<div class="article__detail">
|
||||
|
||||
<?php foreach ( $authors as $author ): ?>
|
||||
|
||||
<a class="article__author" href="<?= get_author_posts_url( $author->ID, $author->user_nicename ); ?>" itemprop="author" itemscope itemtype="https://schema.org/Person">
|
||||
|
||||
<?= $author->display_name; ?>
|
||||
|
||||
<meta itemprop="name" content="<?= htmlspecialchars($author->display_name); ?>" />
|
||||
<link itemprop="url" href="<?= get_author_posts_url( $author->ID, $author->user_nicename ); ?>" />
|
||||
|
||||
</a>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<!--[/post/cell-author]-->
|
||||
9
template-parts/post/cell-date.php
Normal file
9
template-parts/post/cell-date.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<!--[post/cell-date]-->
|
||||
|
||||
<time datetime="<?= get_the_date( "d.m.Y H:i:s" ) ?>" class="article__data">
|
||||
|
||||
<?= get_the_date( "d.m.Y" ) ?>
|
||||
|
||||
</time>
|
||||
|
||||
<!--[/post/cell-date]-->
|
||||
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]-->
|
||||
15
template-parts/post/event-cell-date.php
Normal file
15
template-parts/post/event-cell-date.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<!--[post/event-cell-date]-->
|
||||
|
||||
<?php
|
||||
|
||||
$date = strtotime( get_post_meta( get_the_ID(), "event_date", true ) );
|
||||
|
||||
?>
|
||||
|
||||
<time datetime="<?= date( "d.m.Y H:i:s", $date ) ?>" class="article__data">
|
||||
|
||||
<?= date( "d.m.Y", $date ) ?>
|
||||
|
||||
</time>
|
||||
|
||||
<!--[/post/event-cell-date]-->
|
||||
22
template-parts/post/list-item-author.php
Normal file
22
template-parts/post/list-item-author.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<!--[post/list-item-author]-->
|
||||
|
||||
<?php
|
||||
|
||||
$authors = get_coauthors();
|
||||
|
||||
?>
|
||||
|
||||
<?php foreach ( $authors as $author ): ?>
|
||||
|
||||
<a class="publication__author" href="<?= get_author_posts_url( $author->ID, $author->user_nicename ); ?>" itemprop="author" itemscope itemtype="https://schema.org/Person">
|
||||
|
||||
<?= $author->display_name; ?>
|
||||
|
||||
<meta itemprop="name" content="<?= htmlspecialchars($author->display_name); ?>" />
|
||||
<link itemprop="url" href="<?= get_author_posts_url( $author->ID, $author->user_nicename ); ?>" />
|
||||
|
||||
</a>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<!--[/post/list-item-author]-->
|
||||
9
template-parts/post/list-item-date.php
Normal file
9
template-parts/post/list-item-date.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<!--[post/list-item-date]-->
|
||||
|
||||
<time datetime="<?= get_the_date( "d.m.Y H:i:s" ) ?>" class="publication__number">
|
||||
|
||||
<?= get_the_date( "d.m.Y" ) ?>
|
||||
|
||||
</time>
|
||||
|
||||
<!--[/post/list-item-date]-->
|
||||
Reference in New Issue
Block a user