2026-10-08 GLOBAL
This commit is contained in:
parent
116eb9cd83
commit
8a2a30fc25
@ -115,3 +115,14 @@
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
}
|
||||
|
||||
.page-blog .single-post_author {
|
||||
margin-top: 8px;
|
||||
font-size: 0.9375rem;
|
||||
color: var(--color-text-muted, #475569);
|
||||
}
|
||||
|
||||
.page-blog .single-post_author a {
|
||||
color: var(--color-primary, #7c5cfc);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
/*! blog.css (minified) */
|
||||
.page-blog .blog-section{padding: clamp(40px,5.5vw,72px) clamp(16px,3vw,32px);}.page-blog .blog-grid{display: grid;grid-template-columns: repeat(auto-fill,minmax(min(100%,300px),1fr));gap: clamp(16px,2vw,24px);margin-top: clamp(20px,3vw,32px);}.page-blog .blog-card{display: flex;flex-direction: column;overflow: hidden;background: var(--color-bg,#fff);border: 1px solid var(--color-border,#e2e8f0);border-radius: var(--radius-md,16px);box-shadow: 0 2px 12px rgba(15,23,42,0.06);transition: transform 0.25s ease,box-shadow 0.25s ease;}.page-blog .blog-card:hover{transform: translateY(-4px);box-shadow: 0 10px 28px rgba(15,23,42,0.12);}.page-blog .blog-card__link{display: flex;flex-direction: column;height: 100%;color: inherit;text-decoration: none;}.page-blog .blog-card__media{aspect-ratio: 16 / 10;overflow: hidden;background: var(--color-surface-soft,#f1f5f9);}.page-blog .blog-card__media img{width: 100%;height: 100%;object-fit: cover;}.page-blog .blog-card__body{display: flex;flex-direction: column;gap: 8px;padding: 18px;}.page-blog .blog-card__meta{display: flex;flex-wrap: wrap;gap: 8px 14px;font-size: 0.8125rem;color: var(--color-text-muted,#475569);}.page-blog .blog-card__cat{font-weight: 700;color: var(--color-primary,#7c5cfc);}.page-blog .blog-card__title{margin: 0;font-size: clamp(1.0625rem,1.6vw,1.25rem);line-height: 1.3;overflow-wrap: anywhere;}.page-blog .blog-card__excerpt{margin: 0;font-size: 0.9375rem;line-height: 1.55;color: var(--color-text-muted,#475569);overflow-wrap: anywhere;}.page-blog .blog-pagination{display: flex;flex-wrap: wrap;justify-content: center;gap: 10px;margin-top: clamp(24px,3vw,40px);}.page-blog .blog-pagination .page-numbers{display: inline-flex;align-items: center;justify-content: center;min-width: 44px;height: 44px;padding: 0 14px;border: 1px solid var(--color-border,#e2e8f0);border-radius: 999px;background: #fff;color: var(--color-text,#0f172a);font-weight: 600;text-decoration: none;}.page-blog .blog-pagination .page-numbers.current,.page-blog .blog-pagination .page-numbers:hover{background: var(--color-primary,#7c5cfc);border-color: var(--color-primary,#7c5cfc);color: #fff;}@media (max-width: 639px){.page-blog .blog-card__media{aspect-ratio: 16 / 9;}}
|
||||
.page-blog .blog-section{padding: clamp(40px,5.5vw,72px) clamp(16px,3vw,32px);}.page-blog .blog-grid{display: grid;grid-template-columns: repeat(auto-fill,minmax(min(100%,300px),1fr));gap: clamp(16px,2vw,24px);margin-top: clamp(20px,3vw,32px);}.page-blog .blog-card{display: flex;flex-direction: column;overflow: hidden;background: var(--color-bg,#fff);border: 1px solid var(--color-border,#e2e8f0);border-radius: var(--radius-md,16px);box-shadow: 0 2px 12px rgba(15,23,42,0.06);transition: transform 0.25s ease,box-shadow 0.25s ease;}.page-blog .blog-card:hover{transform: translateY(-4px);box-shadow: 0 10px 28px rgba(15,23,42,0.12);}.page-blog .blog-card__link{display: flex;flex-direction: column;height: 100%;color: inherit;text-decoration: none;}.page-blog .blog-card__media{aspect-ratio: 16 / 10;overflow: hidden;background: var(--color-surface-soft,#f1f5f9);}.page-blog .blog-card__media img{width: 100%;height: 100%;object-fit: cover;}.page-blog .blog-card__body{display: flex;flex-direction: column;gap: 8px;padding: 18px;}.page-blog .blog-card__meta{display: flex;flex-wrap: wrap;gap: 8px 14px;font-size: 0.8125rem;color: var(--color-text-muted,#475569);}.page-blog .blog-card__cat{font-weight: 700;color: var(--color-primary,#7c5cfc);}.page-blog .blog-card__title{margin: 0;font-size: clamp(1.0625rem,1.6vw,1.25rem);line-height: 1.3;overflow-wrap: anywhere;}.page-blog .blog-card__excerpt{margin: 0;font-size: 0.9375rem;line-height: 1.55;color: var(--color-text-muted,#475569);overflow-wrap: anywhere;}.page-blog .blog-pagination{display: flex;flex-wrap: wrap;justify-content: center;gap: 10px;margin-top: clamp(24px,3vw,40px);}.page-blog .blog-pagination .page-numbers{display: inline-flex;align-items: center;justify-content: center;min-width: 44px;height: 44px;padding: 0 14px;border: 1px solid var(--color-border,#e2e8f0);border-radius: 999px;background: #fff;color: var(--color-text,#0f172a);font-weight: 600;text-decoration: none;}.page-blog .blog-pagination .page-numbers.current,.page-blog .blog-pagination .page-numbers:hover{background: var(--color-primary,#7c5cfc);border-color: var(--color-primary,#7c5cfc);color: #fff;}@media (max-width: 639px){.page-blog .blog-card__media{aspect-ratio: 16 / 9;}}.page-blog .single-post_author{margin-top: 8px;font-size: 0.9375rem;color: var(--color-text-muted,#475569);}.page-blog .single-post_author a{color: var(--color-primary,#7c5cfc);font-weight: 600;}
|
||||
@ -1971,6 +1971,17 @@ function add_carbon()
|
||||
|
||||
|
||||
|
||||
Container::make('post_meta', '👤 Автор статьи')
|
||||
->where('post_type', '=', 'post')
|
||||
->add_fields(array(
|
||||
Field::make('association', 'post_author_teacher', 'Автор-педагог (CPT Преподаватели)')
|
||||
->set_types(array(
|
||||
array( 'type' => 'post', 'post_type' => 'teacher' ),
|
||||
))
|
||||
->set_max(1)
|
||||
->set_help_text('ФИО и ссылка на профиль педагога в байлайне статьи и Schema.org BlogPosting. Пусто — берётся общий автор из настроек филиала.'),
|
||||
));
|
||||
|
||||
Container::make('post_meta', 'Поля для преподавателя')
|
||||
->where('post_type', '=', 'teacher')
|
||||
->add_tab('🎬 Hero', array(
|
||||
@ -5941,6 +5952,40 @@ function dekart_branch_add_menu()
|
||||
|
||||
add_action('admin_init', 'dekart_branch_register_settings');
|
||||
|
||||
function dekart_post_author(int $post_id = 0): array
|
||||
{
|
||||
$post_id = $post_id ?: (int) get_the_ID();
|
||||
|
||||
if ($post_id && function_exists('carbon_get_post_meta')) {
|
||||
$raw = carbon_get_post_meta($post_id, 'post_author_teacher');
|
||||
$first = is_array($raw) ? ( $raw[0] ?? null ) : $raw;
|
||||
if (is_array($first)) {
|
||||
$first = $first['value'] ?? '';
|
||||
}
|
||||
$tid = 0;
|
||||
if (is_numeric($first)) {
|
||||
$tid = (int) $first;
|
||||
} elseif (is_string($first) && preg_match('/:(\d+)$/', $first, $m)) {
|
||||
$tid = (int) $m[1];
|
||||
}
|
||||
if ($tid) {
|
||||
return array(
|
||||
'name' => (string) get_the_title($tid),
|
||||
'url' => (string) get_permalink($tid),
|
||||
'is_teacher' => true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$canon = function_exists('dekart_author_canon') ? dekart_author_canon() : array( 'name' => '' );
|
||||
return array(
|
||||
'name' => (string) ( $canon['name'] ?? '' ),
|
||||
'url' => '',
|
||||
'is_teacher' => false,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function dekart_author_defaults(): array
|
||||
{
|
||||
return array(
|
||||
|
||||
@ -1543,7 +1543,7 @@ function dekart_blog_jsonld(): void
|
||||
|
||||
if ($is_post) {
|
||||
$post_id = (int) get_the_ID();
|
||||
$canon = dekart_author_canon();
|
||||
$canon = dekart_author_canon(); // phpcs:ignore
|
||||
$pub_name = (string) get_option('branch_og_site_name');
|
||||
if ('' === trim($pub_name)) {
|
||||
$pub_name = (string) get_option('branch_name');
|
||||
@ -1552,6 +1552,12 @@ function dekart_blog_jsonld(): void
|
||||
$pub_name = (string) get_bloginfo('name');
|
||||
}
|
||||
|
||||
$pa = function_exists('dekart_post_author') ? dekart_post_author($post_id) : array( 'name' => '', 'url' => '' );
|
||||
$author_person = array( '@type' => 'Person', 'name' => wp_strip_all_tags((string) $pa['name']) );
|
||||
if ('' !== (string) $pa['url']) {
|
||||
$author_person['url'] = (string) $pa['url'];
|
||||
}
|
||||
|
||||
$posting = array(
|
||||
'@context' => 'https://schema.org',
|
||||
'@type' => 'BlogPosting',
|
||||
@ -1559,7 +1565,7 @@ function dekart_blog_jsonld(): void
|
||||
'headline' => wp_strip_all_tags(get_the_title($post_id)),
|
||||
'datePublished' => get_the_date('c', $post_id),
|
||||
'dateModified' => get_the_modified_date('c', $post_id),
|
||||
'author' => array( '@type' => 'Person', 'name' => wp_strip_all_tags((string) $canon['name']) ),
|
||||
'author' => $author_person,
|
||||
'publisher' => array( '@type' => 'Organization', 'name' => wp_strip_all_tags($pub_name), 'url' => $home . '/' ),
|
||||
);
|
||||
$desc = wp_strip_all_tags(get_the_excerpt($post_id));
|
||||
@ -1574,7 +1580,7 @@ function dekart_blog_jsonld(): void
|
||||
|
||||
$crumbs = array(
|
||||
array( '@type' => 'ListItem', 'position' => 1, 'name' => 'Главная', 'item' => $home . '/' ),
|
||||
array( '@type' => 'ListItem', 'position' => 2, 'name' => 'Блог', 'item' => $blog_url ),
|
||||
array( '@type' => 'ListItem', 'position' => 2, 'name' => 'Статьи', 'item' => $blog_url ),
|
||||
);
|
||||
if ($is_post) {
|
||||
$crumbs[] = array( '@type' => 'ListItem', 'position' => 3, 'name' => wp_strip_all_tags(get_the_title()), 'item' => get_permalink() );
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
?>
|
||||
<?php
|
||||
get_header();
|
||||
$post_id = get_the_ID();
|
||||
?>
|
||||
<main class="page contacts">
|
||||
|
||||
<section class="contetn-main_block">
|
||||
<div class="container">
|
||||
<h1 class="page_h2"><?php the_title()?></h1>
|
||||
|
||||
<?php
|
||||
$args = array(
|
||||
'posts_per_page' => -1,
|
||||
'offset' => 0,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'post_type' => 'post',
|
||||
);
|
||||
$query = new WP_Query($args); ?>
|
||||
|
||||
<div class="news-wrapper">
|
||||
<?php
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
$post_id = get_the_ID();
|
||||
$cat = get_the_category($post_id);
|
||||
?>
|
||||
<article class="news__item show" data-item-cat="<?php echo $cat[0]->term_id; ?>">
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<span class="news_label_cat">Новости</span>
|
||||
<div class="popular__subject_img">
|
||||
<?php if (has_post_thumbnail()) { ?>
|
||||
<?php the_post_thumbnail(); ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="product-info">
|
||||
<span class="news_label"><?php echo get_the_date('d.m.Y'); ?></span>
|
||||
<h3 class="popular__subject_title"><?php the_title(); ?></h3>
|
||||
<p class="popular__subject_text"><?php echo wp_trim_words(get_the_excerpt(), 25); ?></p>
|
||||
</div>
|
||||
</a>
|
||||
</article>
|
||||
<?php } wp_reset_postdata(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php get_template_part('template-parts/map'); ?>
|
||||
|
||||
</main>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
@ -19,7 +19,7 @@ $blog_query = new WP_Query(array(
|
||||
<main class="page page-blog">
|
||||
<section class="bento blog-section" aria-label="Блог">
|
||||
<div class="bento__full section-header--left">
|
||||
<span class="bento-label">Блог</span>
|
||||
<span class="bento-label">Статьи</span>
|
||||
<h1 class="bento-h2"><?php echo esc_html(get_the_title()); ?></h1>
|
||||
<?php
|
||||
$intro = trim((string) get_post_field('post_content', get_the_ID()));
|
||||
|
||||
@ -13,7 +13,7 @@ $cat = get_the_category($post_id);
|
||||
</svg>
|
||||
</a>
|
||||
</li>
|
||||
<li><a href="<?php echo esc_url(get_permalink(get_page_by_path('novosti')) ?: home_url('/novosti/')); ?>" title="Блог">Блог</a></li>
|
||||
<li><a href="<?php echo esc_url(get_permalink(get_page_by_path('novosti')) ?: home_url('/novosti/')); ?>" title="Статьи">Статьи</a></li>
|
||||
<li><span><?php echo get_the_title(); ?></span></li>
|
||||
</ul>
|
||||
<div class="container">
|
||||
@ -21,7 +21,14 @@ $cat = get_the_category($post_id);
|
||||
<div class="banner-left-part">
|
||||
<time datetime="<?php echo get_the_date('d.m.Y'); ?>"><?php echo get_the_date('d.m.Y'); ?></time>
|
||||
<h1 class="single-post_title"><?php the_title(); ?></h1>
|
||||
<a class="link_cat" href="<?php echo esc_url(get_permalink(get_page_by_path('novosti')) ?: home_url('/novosti/')); ?>">Блог</a>
|
||||
<?php $pa = function_exists('dekart_post_author') ? dekart_post_author() : array( 'name' => '', 'url' => '' ); ?>
|
||||
<?php if ('' !== trim((string) $pa['name'])) : ?>
|
||||
<div class="single-post_author">
|
||||
Автор:
|
||||
<?php if ('' !== (string) $pa['url']) : ?><a href="<?php echo esc_url($pa['url']); ?>"><?php echo esc_html($pa['name']); ?></a><?php else : ?><?php echo esc_html($pa['name']); ?><?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a class="link_cat" href="<?php echo esc_url(get_permalink(get_page_by_path('novosti')) ?: home_url('/novosti/')); ?>">Статьи</a>
|
||||
</div>
|
||||
<div class="banner-right-part">
|
||||
<?php the_post_thumbnail(); ?>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user