71 lines
2.6 KiB
PHP
71 lines
2.6 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_brand = (string) get_option('branch_og_site_name');
|
||
if ('' === trim($branch_brand)) {
|
||
$branch_brand = (string) get_option('branch_name');
|
||
}
|
||
if ('' === trim($branch_brand) && function_exists('carbon_get_theme_option')) {
|
||
$branch_brand = (string) carbon_get_theme_option('site_name');
|
||
}
|
||
$branch_city = function_exists('dekart_branch_city') ? dekart_branch_city() : (string) 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
|
||
$copyright = '' !== trim($branch_brand) ? $branch_brand : 'Частная школа';
|
||
if ('' !== trim($branch_city) && false === mb_stripos($copyright, $branch_city)) {
|
||
$copyright .= ', ' . $branch_city;
|
||
}
|
||
?>
|
||
© <?php echo esc_html(date_i18n('Y')); ?> <?php echo esc_html($copyright); ?>.
|
||
</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>
|