2026-10-08 GLOBAL
This commit is contained in:
parent
ff012cc533
commit
9aedf79e91
@ -12293,6 +12293,7 @@ main > .pksh-section:first-child {
|
||||
.author-info-section {
|
||||
background: var(--bg-surface, #F8FAFC);
|
||||
border-top: 1px solid var(--border-default, #E2E8F0);
|
||||
padding-block: clamp(24px, 4vw, 40px);
|
||||
}
|
||||
.author-info__inner {
|
||||
display: flex;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -231,3 +231,9 @@
|
||||
.family-links__text { font-size: .9rem; color: var(--color-text-muted); }
|
||||
.family-links__arrow { position: absolute; right: 18px; top: 18px; opacity: .5; }
|
||||
@media (max-width: 480px) { .family-links__list { grid-template-columns: 1fr; } }
|
||||
|
||||
/* Хлебные крошки внутри тёмного hero */
|
||||
.page-family-classes .family-hero .breadcrumbs-wrapper { padding: 0; }
|
||||
.page-family-classes .family-hero .breadcrumbs { padding: 0 0 12px !important; color: rgba(255,255,255,.72); }
|
||||
.page-family-classes .family-hero .breadcrumbs a { color: rgba(255,255,255,.72); text-decoration: none; }
|
||||
.page-family-classes .family-hero .breadcrumbs .last_item { color: #fff; }
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -3219,6 +3219,9 @@ function enqueue_template_specific_styles()
|
||||
);
|
||||
}
|
||||
if (is_page_template('page-semejnye-klassy.php')) {
|
||||
// Стили секций главной (price-block и др.) — как на школе
|
||||
$__fp_css = dekart_css_asset('front-page.css');
|
||||
wp_enqueue_style('front-page-style', $__fp_css['url'], array(), $__fp_css['ver']);
|
||||
wp_enqueue_style(
|
||||
'family-classes-style',
|
||||
get_template_directory_uri() . '/assets/css/page-semejnye-klassy.css',
|
||||
@ -3606,6 +3609,54 @@ function dekart_family_classes_url(): string
|
||||
return $id ? (string) get_permalink($id) : '';
|
||||
}
|
||||
|
||||
// Чтение комплексного CF theme option с фолбэком на «сырые» строки опций
|
||||
function dekart_cf_theme_complex(string $name): array
|
||||
{
|
||||
$val = carbon_get_theme_option($name);
|
||||
if (is_array($val) && $val) {
|
||||
return $val;
|
||||
}
|
||||
|
||||
global $wpdb;
|
||||
$rows = $wpdb->get_results($wpdb->prepare(
|
||||
"SELECT option_name, option_value FROM {$wpdb->options} WHERE option_name LIKE %s",
|
||||
$wpdb->esc_like('_' . $name . '|') . '%'
|
||||
));
|
||||
if ($rows) {
|
||||
$items = array();
|
||||
foreach ($rows as $r) {
|
||||
$parts = explode('|', $r->option_name);
|
||||
array_shift($parts);
|
||||
if (end($parts) === 'value') {
|
||||
array_pop($parts);
|
||||
}
|
||||
$sub = $parts[0] ?? '';
|
||||
if ($sub === '') {
|
||||
continue;
|
||||
}
|
||||
$idx = 0;
|
||||
foreach ($parts as $p) {
|
||||
if (ctype_digit($p)) {
|
||||
$idx = (int) $p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$items[$idx][$sub] = $r->option_value;
|
||||
}
|
||||
if ($items) {
|
||||
ksort($items);
|
||||
return array_values($items);
|
||||
}
|
||||
}
|
||||
|
||||
// Сырая опция без префикса (сериализованный массив)
|
||||
$raw = get_option($name);
|
||||
if (is_array($raw) && $raw) {
|
||||
return $raw;
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
// Нормализация CF-association → массив ID
|
||||
function dekart_assoc_ids($val): array
|
||||
{
|
||||
|
||||
@ -44,7 +44,6 @@ get_header();
|
||||
$fam_teacher_cta = carbon_get_theme_option('family_teacher_cta');
|
||||
$fam_reviews_title = carbon_get_theme_option('family_reviews_title');
|
||||
|
||||
get_template_part('template-parts/family/breadcrumbs');
|
||||
get_template_part('template-parts/family/hero');
|
||||
get_template_part('template-parts/family/what-is');
|
||||
get_template_part('template-parts/family/fit');
|
||||
|
||||
@ -8,7 +8,15 @@ if (! defined('ABSPATH')) {
|
||||
|
||||
$title = carbon_get_theme_option('family_compare_title');
|
||||
$text = carbon_get_theme_option('family_compare_text');
|
||||
$rows = (array) carbon_get_theme_option('family_compare_rows');
|
||||
$rows = function_exists('dekart_cf_theme_complex')
|
||||
? dekart_cf_theme_complex('family_compare_rows')
|
||||
: (array) carbon_get_theme_option('family_compare_rows');
|
||||
|
||||
// Только строки с заполненным параметром
|
||||
$rows = array_values(array_filter((array) $rows, function ($r) {
|
||||
return is_array($r) && trim((string) ($r['param'] ?? '')) !== '';
|
||||
}));
|
||||
|
||||
if (! $rows) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ $f_hours = get_option('branch_work_hours') ?: get_option('branch_hours');
|
||||
?>
|
||||
<section class="ds-hero family-hero" aria-labelledby="family-hero-title">
|
||||
<div class="ds-container">
|
||||
<?php get_template_part('template-parts/family/breadcrumbs'); ?>
|
||||
<div class="ds-hero__inner">
|
||||
<div class="ds-hero__content">
|
||||
|
||||
|
||||
@ -7,7 +7,9 @@ if (! defined('ABSPATH')) {
|
||||
}
|
||||
|
||||
$title = carbon_get_theme_option('family_links_title');
|
||||
$links = (array) carbon_get_theme_option('family_links');
|
||||
$links = function_exists('dekart_cf_theme_complex')
|
||||
? dekart_cf_theme_complex('family_links')
|
||||
: (array) carbon_get_theme_option('family_links');
|
||||
|
||||
// Дефолт: перелинковка со школой и кластером (если CF пуст)
|
||||
if (! $links) {
|
||||
|
||||
@ -9,13 +9,27 @@ if (! defined('ABSPATH')) {
|
||||
$f_title = carbon_get_theme_option('family_price_title');
|
||||
$f_note = carbon_get_theme_option('family_price_note');
|
||||
|
||||
// Источник: страница главной (page_on_front); фолбэк — страница школы
|
||||
$src_id = (int) get_option('page_on_front');
|
||||
$cards = $src_id ? carbon_get_post_meta($src_id, 'price_cards') : array();
|
||||
// Источник CF: 1) страница школы (price_cards), 2) фолбэк — главная
|
||||
$src_id = 0;
|
||||
$cards = array();
|
||||
|
||||
if (empty($cards) || ! is_array($cards)) {
|
||||
$src_id = function_exists('dekart_page_id_by_template') ? dekart_page_id_by_template('page-elementary-school.php') : 0;
|
||||
$cards = $src_id ? carbon_get_post_meta($src_id, 'price_cards') : array();
|
||||
$school_id = function_exists('dekart_page_id_by_template') ? dekart_page_id_by_template('page-elementary-school.php') : 0;
|
||||
if ($school_id) {
|
||||
$c = carbon_get_post_meta($school_id, 'price_cards');
|
||||
if (! empty($c) && is_array($c)) {
|
||||
$src_id = $school_id;
|
||||
$cards = $c;
|
||||
}
|
||||
}
|
||||
if (! $cards) {
|
||||
$home_id = (int) get_option('page_on_front');
|
||||
if ($home_id) {
|
||||
$c = carbon_get_post_meta($home_id, 'price_cards');
|
||||
if (! empty($c) && is_array($c)) {
|
||||
$src_id = $home_id;
|
||||
$cards = $c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($cards) || ! is_array($cards)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user