58 lines
2.2 KiB
PHP
58 lines
2.2 KiB
PHP
<?php
|
||
|
||
// Автор, даты и копирайт
|
||
|
||
if (! defined('ABSPATH')) {
|
||
exit;
|
||
}
|
||
|
||
$post_id = get_the_ID();
|
||
|
||
$args = isset($args) && is_array($args) ? $args : array();
|
||
$canon = dekart_author_canon($args);
|
||
|
||
$author_name = $canon['name'];
|
||
$author_creds = trim($canon['creds'] . ($canon['stazh'] !== '' ? ', ' . $canon['stazh'] : ''), ', ');
|
||
|
||
|
||
$publish_date = $post_id ? get_the_date('c', $post_id) : '';
|
||
$modified_date = $post_id ? get_the_modified_date('c', $post_id) : '';
|
||
$publish_fmt = $publish_date ? date_i18n('j F Y', strtotime($publish_date)) : '';
|
||
$modified_fmt = $modified_date ? date_i18n('j F Y', strtotime($modified_date)) : '';
|
||
|
||
// ── Город для копирайта ──
|
||
$branch_city = get_option('branch_city') ?: 'Щёлково';
|
||
|
||
if (empty($author_name) && empty($publish_fmt) && empty($modified_fmt)) {
|
||
return;
|
||
}
|
||
?>
|
||
<section class="author-info-section section-bg" data-bg="author-info" aria-label="Информация об авторе">
|
||
<div class="container">
|
||
<div class="author-info__inner">
|
||
<div class="author-info__copyright">
|
||
© <?php echo esc_html(date_i18n('Y')); ?> Частная школа «Декарт», <?php echo esc_html($branch_city); ?>.
|
||
</div>
|
||
|
||
<?php if ($author_name) : ?>
|
||
<div class="author-info__author">
|
||
<span class="author-info__label">Автор контента:</span>
|
||
<span class="author-info__name"><?php echo esc_html($author_name); ?></span>
|
||
<?php if ($author_creds) : ?>
|
||
<span class="author-info__creds">— <?php echo esc_html($author_creds); ?></span>
|
||
<?php endif; ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
|
||
<div class="author-info__dates">
|
||
<?php if ($publish_fmt) : ?>
|
||
<span>Дата публикации: <?php echo esc_html($publish_fmt); ?></span>
|
||
<?php endif; ?>
|
||
<?php if ($modified_fmt) : ?>
|
||
<span>Дата обновления: <?php echo esc_html($modified_fmt); ?></span>
|
||
<?php endif; ?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|