2026-10-08 GLOBAL

This commit is contained in:
Dekart Deploy Bot 2026-10-08 16:59:02 +00:00
parent 80f576d3a7
commit f364a17094
76 changed files with 551 additions and 937 deletions

File diff suppressed because one or more lines are too long

View File

@ -11424,12 +11424,11 @@ main > .pksh-section:first-child {
border: 1px solid var(--color-border, #E2E8F0);
border-radius: var(--radius-lg, 24px);
overflow: hidden;
transition: box-shadow .25s, transform .25s, border-color .25s;
transition: box-shadow .25s, transform .25s;
}
.teachers-card:hover {
box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, .08));
transform: translateY(-3px);
border-color: rgba(37, 99, 235, .35);
}
.teachers-card.is-hidden {
display: none;

File diff suppressed because one or more lines are too long

View File

@ -237,6 +237,7 @@
.page-family-classes .family-hero .breadcrumbs .last_item { color: #fff; }
.page-family-classes .family-hero__media { flex: 1 1 0; min-width: 0; }
.page-family-classes .family-hero__media picture { display: block; }
.page-family-classes .family-hero__media img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); object-fit: cover; }
@media (max-width: 860px) {
.page-family-classes .family-hero__media { flex: none; width: 100%; max-width: 520px; margin: 0 auto; }

File diff suppressed because one or more lines are too long

View File

@ -50,7 +50,6 @@ document.addEventListener("click", function (event) {
if (target.classList.contains("certificates__item_img")) {
const screen = document.querySelector('.screen-certificates');
//screen.querySelector('.screen-certificates__img').innerHTML = event.target.outerHTML;
document.querySelector('html').style = "overflow: hidden;"
screen.classList.add('open');
return;
@ -245,7 +244,6 @@ document.querySelectorAll('.header-menu').forEach(item => {
window.addEventListener('scroll', onScroll, { passive: true });
window.addEventListener('resize', onResize, { passive: true });
if ('ResizeObserver' in window) {
// измерение — отдельным кадром, чтобы не читать геометрию в кадре изменений DOM
new ResizeObserver(function () { window.requestAnimationFrame(measure); }).observe(document.documentElement);
}
@ -269,12 +267,10 @@ document.querySelectorAll('.header-menu').forEach(item => {
observer.observe(hero);
})();
/* ── Mobile banner padding: compensate for fixed header ── */
(function() {
var banner = document.querySelector('.page-pksh .banner');
var header = document.querySelector('.header');
if (banner && header && window.innerWidth <= 860) {
// чтение высоты и запись — в отдельном кадре (без синхронного reflow)
window.requestAnimationFrame(function () {
var headerH = header.offsetHeight || 76;
banner.style.paddingTop = headerH + 'px';
@ -307,7 +303,6 @@ document.querySelectorAll('.mystyle-accordion-trigger').forEach(trigger => {
}
});
});
// Разделители между пунктами главного меню (как flex-элементы → по центру промежутка)
(function () {
function injectMenuSeparators() {
var menu = document.querySelector('.header-menu');

View File

@ -1,9 +1,6 @@
/**
* Админ: Настройки филиала — вертикальные вкладки.
*
* Секции .branch-section превращаются в панели: слева список-навигация,
* справа содержимое активной вкладки. Активная вкладка запоминается
* (localStorage) и отражается в #hash — удобно для ссылок/перезагрузок.
* Старый аккордеон (h2) остаётся в DOM, но скрыт.
*/
(function () {
@ -48,13 +45,10 @@
buttons.push(btn);
});
// Встраиваем каркас ПЕРЕД перемещением секций (form.insertBefore
// с отвязанным узлом падал бы — секции оставались вне формы).
form.insertBefore(wrap, list[0]);
wrap.appendChild(nav);
wrap.appendChild(content);
// Переносим секции в область контента уже после подключения каркаса.
list.forEach(function (section) {
section.classList.remove('collapsed');
section.setAttribute('role', 'tabpanel');

View File

@ -1,13 +1,8 @@
/**
* Админ: страховка вкладок Carbon Fields (преподаватель).
*
* Carbon строит вкладки через React не мгновенно — на короткое время поля
* могут быть видны списком. Если после полной загрузки вкладки так и не
* собрались (класс cf-container--tabbed есть, списка вкладок нет) — это
* сбой инициализации CF: помечаем метабокс красной рамкой и логируем,
* чтобы починить корень, а не камуфлировать.
*
* Никаких авто-перезагрузок: можно потерять несохранённые правки.
*/
(function () {
'use strict';

View File

@ -1,7 +1,6 @@
/**
* Страница КЛАССА начальной школы (page-class.php)
* Лёгкие улучшения: плавная прокрутка к якорю формы записи.
* Reveal-анимации (IntersectionObserver) — глобальные в add.js.
*
* @package Dekart
*/

View File

@ -1,6 +1,4 @@
/**
* Страница "Преподаватели" — фильтр карточек + reveal-анимации.
* Фильтры читаются из кнопок .teachers-filter__btn[data-filter],
* карточки фильтруются по .teachers-card[data-category].
*/
(function () {

View File

@ -1,7 +1,5 @@
/**
* Sticky CTA — shows desktop bar when hero scrolls out of view
*
* IntersectionObserver on .ds-hero; toggles .visible on .sticky-cta-desktop.
*
* @package Dekart
*/

View File

@ -1,11 +1,7 @@
/**
* Honest countdown timer — Подготовка к школе
*
* Reads deadline timestamp (seconds) from .honest-timer[data-deadline].
* Finds [data-timer] children within that timer container only.
* Updates (d, h, m, s) via requestAnimationFrame. Stops at 00:00:00:00.
*
* Поддерживает несколько таймеров на одной странице (cta-test + final-cta).
* Каждый экземпляр получает собственную замыкание.
*
* @package Dekart

View File

@ -8,10 +8,8 @@
document.addEventListener('DOMContentLoaded', function () {
'use strict';
// ───────────────────────────────────────────────
// 1. АНИМАЦИЯ ПОЯВЛЕНИЯ (Intersection Observer)
// fallback — add.js тоже содержит этот код
// ───────────────────────────────────────────────
const revealElements = document.querySelectorAll('.reveal');
if (revealElements.length && 'IntersectionObserver' in window) {
const observer = new IntersectionObserver(
@ -34,10 +32,8 @@ document.addEventListener('DOMContentLoaded', function () {
});
}
// ───────────────────────────────────────────────
// 2. КНОПКА "ПОКАЗАТЬ ЕЩЁ" (десктоп)
// fallback — add.js тоже содержит этот код
// ───────────────────────────────────────────────
const loadMoreBtn = document.getElementById('reviews-loadmore');
if (loadMoreBtn) {
let nextBatch = 2;
@ -60,11 +56,9 @@ document.addEventListener('DOMContentLoaded', function () {
}
}
// ───────────────────────────────────────────────
// 4. FAQ Accordion — keyboard + ARIA
// Глобальный click handler в add.js обрабатывает
// .box__accordion_label, синхронизируем aria-expanded
// ───────────────────────────────────────────────
document.querySelectorAll('.box__accordion_label').forEach(function (label) {
label.addEventListener('keydown', function (e) {
if (e.key === 'Enter' || e.key === ' ') {
@ -80,9 +74,7 @@ document.addEventListener('DOMContentLoaded', function () {
});
});
// ───────────────────────────────────────────────
// 5. СЧЁТЧИК (CountUp) для цифр доверия
// ───────────────────────────────────────────────
function animateCounter(el) {
const target = parseInt(el.getAttribute('data-target-value'), 10) ||
parseInt(el.getAttribute('data-target'), 10);
@ -118,9 +110,7 @@ document.addEventListener('DOMContentLoaded', function () {
}
});
// ───────────────────────────────────────────────
// 6. STICKY CTA (мобильные) — троттлинг скролла
// ───────────────────────────────────────────────
const stickyCta = document.querySelector('.sticky-cta-mobile');
if (stickyCta) {
const heroSection = document.querySelector('.reviews-hero');
@ -143,9 +133,7 @@ document.addEventListener('DOMContentLoaded', function () {
}
}
// ───────────────────────────────────────────────
// 7. POPUP ФОРМЫ ОТЗЫВА (iframe)
// ───────────────────────────────────────────────
const formBtn = document.querySelector('.review-form-block__btn');
if (formBtn) {
formBtn.addEventListener('click', function () {
@ -169,9 +157,7 @@ document.addEventListener('DOMContentLoaded', function () {
});
}
// ───────────────────────────────────────────────
// 8. ЦЕЛИ ЯНДЕКС.МЕТРИКИ
// ───────────────────────────────────────────────
function reachGoal(name) {
if (typeof yaCounter99835482 !== 'undefined') {
try {

View File

@ -1,6 +1,4 @@
/**
* Личная страница преподавателя — кейсы (табы), sticky CTA (mobile).
* Reveal-анимации глобальные (add.js), здесь только интерактив страницы.
*/
(function () {
'use strict';
@ -25,7 +23,6 @@
});
}
// ── Sticky CTA (mobile): показать после hero, скрыть у финального CTA ──
var sticky = document.querySelector('.teacher-single__sticky');
if (sticky) {
var hero = document.querySelector('.teacher-single__hero');

View File

@ -1,7 +1,6 @@
/**
* Sticky CTA — shared IntersectionObserver
*
* Shows desktop sticky bar when hero/sections scroll out of view.
* Mobile sticky is CSS-only (always visible).
*
* @package Dekart

View File

@ -1,79 +1,71 @@
/**
* Yandex Maps lazy loader — shared across all pages
*
* Activates only when #ya-map[data-coords] is present.
* Loads Yandex Maps API on first scroll > 100px (passive) or after 3s fallback.
* Creates map with a placemark at the given coordinates.
*
* Required data attributes on #ya-map:
* data-coords — comma-separated lat,lng (e.g. "55.7558,37.6173")
* data-label — placemark text (e.g. "Частная школа «Декарт»")
*
* @package Dekart
*/
(function () {
var mapEl = document.getElementById('ya-map');
if (!mapEl) return;
var mapEl = document.getElementById('ya-map');
if (!mapEl) return;
var coordsAttr = mapEl.getAttribute('data-coords');
var label = mapEl.getAttribute('data-label') || '';
if (!coordsAttr) return;
var coordsAttr = mapEl.getAttribute('data-coords');
var label = mapEl.getAttribute('data-label') || '';
if (!coordsAttr) return;
var parts = coordsAttr.split(',');
if (parts.length < 2) return;
var mapCoords = [parseFloat(parts[0]), parseFloat(parts[1])];
if (isNaN(mapCoords[0]) || isNaN(mapCoords[1])) return;
var parts = coordsAttr.split(',');
if (parts.length < 2) return;
var mapCoords = [parseFloat(parts[0]), parseFloat(parts[1])];
if (isNaN(mapCoords[0]) || isNaN(mapCoords[1])) return;
var mapLoaded = false;
var apiLoading = false;
var mapLoaded = false;
var apiLoading = false;
function initMap() {
if (typeof ymaps === 'undefined') return;
ymaps.ready(function () {
var map = new ymaps.Map('ya-map', {
center: mapCoords,
zoom: 16
}, {
searchControlProvider: 'yandex#search'
});
var placemark = new ymaps.Placemark(
mapCoords,
{ iconContent: label },
{ preset: 'islands#redStretchyIcon' }
);
map.geoObjects.add(placemark);
mapLoaded = true;
});
}
function loadYandexMaps() {
if (mapLoaded || apiLoading) return;
apiLoading = true;
var script = document.createElement('script');
script.src = 'https://api-maps.yandex.ru/2.1/?lang=ru_RU';
script.onerror = function () {
apiLoading = false;
};
script.onload = initMap;
document.head.appendChild(script);
}
// Scroll trigger — first >100px
function onScroll() {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
if (scrollTop > 100) {
loadYandexMaps();
window.removeEventListener('scroll', onScroll);
function initMap() {
if (typeof ymaps === 'undefined') return;
ymaps.ready(function () {
var map = new ymaps.Map('ya-map', {
center: mapCoords,
zoom: 16
}, {
searchControlProvider: 'yandex#search'
});
map.geoObjects.add(new ymaps.Placemark(
mapCoords,
{ iconContent: label },
{ preset: 'islands#redStretchyIcon' }
));
mapLoaded = true;
});
}
}
// Fallback — 3 seconds after page load
window.addEventListener('load', function () {
setTimeout(function () {
if (!mapLoaded && !apiLoading) loadYandexMaps();
}, 3000);
});
function loadYandexMaps() {
if (mapLoaded || apiLoading) return;
apiLoading = true;
var script = document.createElement('script');
script.src = 'https://api-maps.yandex.ru/2.1/?lang=ru_RU';
script.onerror = function () { apiLoading = false; };
script.onload = initMap;
document.head.appendChild(script);
}
window.addEventListener('scroll', onScroll, { passive: true });
function activate() {
loadYandexMaps();
mapEl.removeEventListener('click', activate);
if (observer) observer.disconnect();
}
var observer = null;
if ('IntersectionObserver' in window) {
observer = new IntersectionObserver(function (entries) {
for (var i = 0; i < entries.length; i++) {
if (entries[i].isIntersecting) { activate(); }
}
}, { rootMargin: '300px 0px' });
observer.observe(mapEl);
} else {
var onScroll = function () {
if ((window.pageYOffset || document.documentElement.scrollTop) > 100) {
window.removeEventListener('scroll', onScroll);
activate();
}
};
window.addEventListener('scroll', onScroll, { passive: true });
}
// Клик по плейсхолдеру — немедленная загрузка
mapEl.addEventListener('click', activate);
})();

View File

@ -1,18 +1,11 @@
<?php
/**
* Deploy Runner — HTTP-triggered migration executor (token-gated)
* Usage: https://site.com/wp-content/themes/dekart/deploy-runner.php?token=SECRET&migrate=003
* (or send the secret in the `X-Deploy-Token` header)
*
* Self-destructs after execution (renames to .done).
* Requires wp-config.php for DB credentials.
*/
// Prevent WordPress from intercepting
define('WP_USE_THEMES', false);
// Load WordPress config for DB credentials (needed by the token gate below).
$wp_config_path = dirname(__FILE__) . '/../../../wp-config.php';
if (!file_exists($wp_config_path)) {
// Try parent directory
@ -23,14 +16,14 @@ if (!file_exists($wp_config_path)) {
}
require_once $wp_config_path;
// ─── Security: token gate (fail closed) ──────────────────────────────
// The endpoint runs DB/theme migrations, so it must never be reachable
// anonymously. The secret is taken from, in order: DEPLOY_RUNNER_TOKEN
// (env var or wp-config constant), or the wp_options row
// `dekart_deploy_token`. With no secret configured, every request is
// denied with 404 — the endpoint stays closed until a secret is set.
// Set the option once (recommended, no file edits):
// wp option update dekart_deploy_token "$(openssl rand -hex 24)"
$dk_expected = '';
if (getenv('DEPLOY_RUNNER_TOKEN')) {
$dk_expected = (string) getenv('DEPLOY_RUNNER_TOKEN');
@ -68,7 +61,7 @@ if (!in_array($migrate, $allowed_migrations)) {
header('Content-Type: text/plain; charset=utf-8');
echo "=== Deploy Runner: migration $migrate ===\n\n";
// ─── Shared helpers ──────────────────────────────────────────────────
function dp_get_wpdb()
{
$conn = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
@ -87,7 +80,7 @@ function dp_get_theme_dir()
return $theme_dir;
}
// Позиция //-комментария вне строковых литералов или false
function dp_js_comment_pos($line)
{
$len = strlen($line);
@ -116,7 +109,7 @@ function dp_js_comment_pos($line)
return false;
}
// Удаляет //-комментарии (строки и хвосты), переносы строк сохраняет
function dp_strip_js_comments($code)
{
$parts = preg_split('/(\r\n|\n|\r)/', $code, -1, PREG_SPLIT_DELIM_CAPTURE);
@ -140,7 +133,7 @@ function dp_strip_js_comments($code)
}
if ($migrate === '003') {
// Fix banner_text typo: rарантированная → гарантированная
$conn = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
if (!$conn) {
die("DB connection failed: " . mysqli_connect_error() . "\n");
@ -186,7 +179,7 @@ if ($migrate === '003') {
}
if ($migrate === '004') {
// ─── 004a: Remove post 740 (custom-css-js orphan) ───
$conn = dp_get_wpdb();
$post_740 = mysqli_query($conn, "SELECT ID FROM wp_posts WHERE ID = 740 AND post_type = 'custom-css-js'");
@ -213,7 +206,7 @@ if ($migrate === '004') {
echo "ℹ️ Post ID 740 not found — already removed\n";
}
// ─── 004b: Clean wp_custom_css option ───
// We need wp-load.php for get_option/update_option
$wp_load = dirname(__FILE__) . '/../../../wp-load.php';
if (!file_exists($wp_load)) {
@ -255,8 +248,8 @@ if ($migrate === '004') {
}
if ($migrate === '005') {
// Технический SEO: robots.txt в webroot (Clean-param для рекламных меток) + сброс OPcache.
// Деплой синкает только тему, root-файлы (robots.txt) в webroot не попадают — пишем напрямую.
$abspath = dirname(__DIR__, 3); // themes/dekart -> themes -> wp-content -> ABSPATH
$robots = $abspath . '/robots.txt';
$needle = 'Clean-param: clckid&yclid&gclid&etext&y_ref /';
@ -291,8 +284,8 @@ if ($migrate === '005') {
}
if ($migrate === '006') {
// Чистка построчных //-комментариев в inline-JS сниппете плагина custom-css-js (post 518 «B24form»).
// Правим и БД, и физический файл uploads/custom-css-js/518.js (плагин отдаёт его как есть).
$conn = dp_get_wpdb();
$post_id = 518;
@ -336,7 +329,7 @@ if ($migrate === '006') {
echo "\n=== Migration complete ===\n";
// Self-destruct: rename this file (кроме 005 — оставляем для повторного сброса OPcache)
$self = __FILE__;
$done = $self . '.done';
if ($migrate !== '005') {

View File

@ -1,6 +1,6 @@
<?php wp_footer(); ?>
<?php
// Внешний сайт ЕГЭ/ОГЭ филиала ({branch}.dekart-school.ru)
$exam_host = (string) wp_parse_url(home_url('/'), PHP_URL_HOST);
$exam_url = ( $exam_host && str_ends_with($exam_host, '.dekart.school') )
? 'https://' . preg_replace('/\.dekart\.school$/', '.dekart-school.ru', $exam_host) . '/'
@ -74,8 +74,8 @@ $exam_url = ( $exam_host && str_ends_with($exam_host, '.dekart.school') )
<?php
?>
<?php
// === Bitrix24: парсинг скрипта из настроек филиала ===
// Приоритет: branch_button_script (Settings API) > theme option
$b24_raw = get_option('branch_button_script', '');
if (empty($b24_raw)) {
$b24_raw = carbon_get_theme_option('site_bitrix_script');

View File

@ -1,7 +1,5 @@
<?php
/*
Template Name: шаблон главной страницы
*/
get_header();
$post_id = get_the_ID();

File diff suppressed because it is too large Load Diff

View File

@ -12,18 +12,18 @@
<link rel="dns-prefetch" href="//api-maps.yandex.ru">
<link rel="dns-prefetch" href="//mod.gudok.tel">
<?php
// ─────────────────────────────────────────────────────────────────────
// PRELOAD 1
// ─────────────────────────────────────────────────────────────────────
?>
<link rel="preload" as="image"
href="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/logo-svg.svg"
type="image/svg+xml">
<?php
// ─────────────────────────────────────────────────────────────────────
// PRELOAD LCP: podgotovka-k-shkole
// ─────────────────────────────────────────────────────────────────────
if (is_page_template('page-podgotovka-k-shkole.php')) {
$pksh_img_id = carbon_get_post_meta(get_the_ID(), 'banner_image');
if ($pksh_img_id) {
@ -34,9 +34,9 @@ if (is_page_template('page-podgotovka-k-shkole.php')) {
}
}
// ─────────────────────────────────────────────────────────────────────
// PRELOAD LCP: front page
// ─────────────────────────────────────────────────────────────────────
if (is_front_page()) {
$post_id = get_the_ID();
$foto_id = carbon_get_post_meta($post_id, 'banner_img_desktop');
@ -53,9 +53,9 @@ if (is_front_page()) {
?>
<?php
// ─────────────────────────────────────────────────────────────────────
// CSS12
// ─────────────────────────────────────────────────────────────────────
?>
<style id="reset-css-inline">/*! reset.css inline */ *{margin:0;padding:0;box-sizing:border-box}html{scroll-behavior:smooth}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img{max-width:100%;height:auto;display:block}a{color:inherit;text-decoration:none}button{cursor:pointer;font:inherit}ul,ol{list-style:none}table{border-collapse:collapse}input,textarea,select{font:inherit}</style>
@ -92,7 +92,7 @@ if (is_front_page()) {
<link rel="preload" as="style" href="<?php echo esc_url(get_template_directory_uri() . '/assets/css/fonts.css?ver=' . filemtime(get_template_directory() . '/assets/css/fonts.css')); ?>" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="<?php echo esc_url(get_template_directory_uri() . '/assets/css/fonts.css?ver=' . filemtime(get_template_directory() . '/assets/css/fonts.css')); ?>"></noscript>
<?php if (is_front_page()) : // предзагрузка начертаний hero — LCP/CLS ?>
<?php if (is_front_page()) : ?>
<link rel="preload" as="font" type="font/woff2" crossorigin href="<?php echo esc_url(get_template_directory_uri() . '/assets/fonts/Roboto-400.woff2'); ?>">
<link rel="preload" as="font" type="font/woff2" crossorigin href="<?php echo esc_url(get_template_directory_uri() . '/assets/fonts/Roboto-600.woff2'); ?>">
<link rel="preload" as="font" type="font/woff2" crossorigin href="<?php echo esc_url(get_template_directory_uri() . '/assets/fonts/PlusJakartaSans-700.woff2'); ?>">

View File

@ -1,14 +1,6 @@
<?php
/**
* Pksh_Data — централизованная загрузка данных для page-podgotovka-k-shkole.php
*
* Синглтон. Кэширует все carbon_get_post_meta() и get_option() вызовы.
* Каждый template-part вызывает Pksh_Data::instance() -> get_*().
* Повторные вызовы instance() возвращают тот же объект — без дублирования запросов.
*
* @package Dekart
*/
if (! defined('ABSPATH')) {
exit;
@ -19,7 +11,7 @@ class Pksh_Data
private static ?Pksh_Data $instance = null;
private int $post_id;
/** @var array Кэш branch-данных (get_option с fallback) */
private array $branch = [];
/** @var array Кэш page-specific meta */
@ -39,9 +31,7 @@ class Pksh_Data
$this->post_id = get_the_ID();
}
/**
* Получить экземпляр (синглтон)
*/
public static function instance(): self
{
if (null === self::$instance) {
@ -50,9 +40,9 @@ class Pksh_Data
return self::$instance;
}
// ============================================================
// BRANCH / OPTION DATA (get_option -> theme_option -> post_meta)
// ============================================================
public function get_address(): string
{
@ -235,9 +225,9 @@ class Pksh_Data
return $this->branch['logistics_nearby'];
}
// ============================================================
// AUTHOR / DATES (E-E-A-T / GEO)
// ============================================================
public function get_author_name(): string
{
@ -251,12 +241,7 @@ class Pksh_Data
return $this->page['author_name'];
}
/**
* Количество лет на рынке (из года основания).
* Автоматически: текущий год − год основания.
* Источник: CF schema_founded → Settings API branch_founded.
* Если год основания не задан — 0.
*/
public function get_years_on_market(): int
{
if (! array_key_exists('years_market', $this->page)) {
@ -291,9 +276,9 @@ class Pksh_Data
return $this->page['modified_date'];
}
// ============================================================
// HERO / BANNER
// ============================================================
public function get_banner_image_id(): int
{
@ -328,10 +313,7 @@ class Pksh_Data
return $this->page['subtitle_footnote_link'];
}
/**
* Определение для AI-цитирования (GEO, первые 60 слов).
* Заполняется в админке: вкладка "🖼️ Герой" -> поле "Определение для AI".
*/
public function get_hero_definition(): string
{
if (! array_key_exists('hero_definition', $this->page)) {
@ -340,9 +322,9 @@ class Pksh_Data
return $this->page['hero_definition'];
}
// ============================================================
// SOCIAL COUNTERS (complex)
// ============================================================
public function get_social_counters(): array
{
@ -358,9 +340,9 @@ class Pksh_Data
return array( 'icon-graduation', 'icon-calendar', 'icon-star-filled', 'icon-teacher' );
}
// ============================================================
// PROGRAMS
// ============================================================
public function get_base_program(): array
{
@ -394,9 +376,9 @@ class Pksh_Data
return $this->programs['prem'];
}
// ============================================================
// GEO ANSWER BLOCKS (self-contained, 134-167 слов)
// ============================================================
public function get_geo_answer_programs(): string
{
@ -446,9 +428,9 @@ class Pksh_Data
return $this->page['geo_q3'];
}
// ============================================================
// COMPARE TABLE (complex)
// ============================================================
public function get_compare_rows(): array
{
@ -467,9 +449,9 @@ class Pksh_Data
return $this->page['footnote'];
}
// ============================================================
// TEACHERS (complex)
// ============================================================
public function get_teachers(): array
{
@ -480,9 +462,9 @@ class Pksh_Data
return $this->teachers;
}
// ============================================================
// REVIEWS (complex)
// ============================================================
public function get_reviews(): array
{
@ -493,9 +475,9 @@ class Pksh_Data
return $this->reviews;
}
// ============================================================
// FAQ (complex)
// ============================================================
public function get_faq_items(): array
{
@ -506,9 +488,9 @@ class Pksh_Data
return $this->faq;
}
// ============================================================
// GALLERY (complex)
// ============================================================
public function get_gallery(): array
{
@ -519,9 +501,9 @@ class Pksh_Data
return $this->gallery;
}
// ============================================================
// HONEST TIMER
// ============================================================
public function get_honest_deadline(): int
{

View File

@ -1,27 +1,12 @@
<?php
// WP-CLI: импорт Carbon Fields из JSON → theme options / мета поста
if (! defined('WP_CLI') || ! WP_CLI) {
return;
}
class Dekart_CF_Import {
/**
* Импорт значений Carbon Fields из JSON-файла.
*
* ## OPTIONS
*
* <file> Путь к JSON: {"field_name": value, ...}
* [--post=<id>] Писать как мета поста (carbon_set_post_meta) вместо опций темы.
* [--dry-run] Только показать, не писать.
*
* ## EXAMPLES
*
* wp dekart import-cf family.json
* wp dekart import-cf page.json --post=1190
*
* @when after_wp_load
*/
public function __invoke($args, $assoc_args) {
$file = isset($args[0]) ? (string) $args[0] : '';
if ($file === '' || ! is_readable($file)) {
@ -64,17 +49,10 @@ class Dekart_CF_Import {
WP_CLI::add_command('dekart import-cf', 'Dekart_CF_Import');
/**
* Миграция прежних family_* (опции темы) в мета страницы «Семейные классы».
*/
class Dekart_Family_Migrate {
/**
* ## OPTIONS
* [--dry-run]
*
* @when after_wp_load
*/
public function __invoke($args, $assoc_args) {
if (! function_exists('dekart_page_id_by_template') || ! function_exists('dekart_cf_theme_complex')) {
WP_CLI::error('Тема не загружена (нет хелперов).');

View File

@ -1,5 +1,5 @@
<?php
// WP-CLI: serialize-safe замена строки A → B в БД (posts, options, postmeta)
if (! defined('WP_CLI') || ! WP_CLI) {
return;
}
@ -15,25 +15,7 @@ class Dekart_City_Replace {
/** @var int */
private $changed = 0;
/**
* Замена строки в wp_posts (post_content, post_title), wp_options, wp_postmeta.
*
* ## OPTIONS
*
* --from=<str> Искомая строка.
* --to=<str> Строка замены.
* [--dry-run] Только показать, ничего не писать.
* [--posts=<0|1>] Обрабатывать wp_posts (по умолчанию 1).
* [--options=<0|1>] Обрабатывать wp_options (по умолчанию 1).
* [--postmeta=<0|1>] Обрабатывать wp_postmeta (по умолчанию 1).
*
* ## EXAMPLES
*
* wp dekart city-replace --from="Щелково" --to="Щёлково" --dry-run
* wp dekart city-replace --from="Щелково" --to="Щёлково"
*
* @when after_wp_load
*/
public function __invoke($args, $assoc_args) {
$this->from = isset($assoc_args['from']) ? (string) $assoc_args['from'] : '';
$this->to = isset($assoc_args['to']) ? (string) $assoc_args['to'] : '';
@ -132,7 +114,7 @@ class Dekart_City_Replace {
}
}
/** Значение: если serialized — распаковать/заменить/запаковать, иначе строка. */
private function replace_value($value) {
if (! is_string($value) || '' === $value) {
return $value;
@ -147,7 +129,7 @@ class Dekart_City_Replace {
return $this->replace_string($value);
}
/** Рекурсия по массивам/объектам, ключ @id пропускается. */
private function replace_recursive($data) {
if (is_array($data)) {
$out = array();
@ -175,7 +157,7 @@ class Dekart_City_Replace {
return $data;
}
/** Строка: замена, но URL и @id не трогаем. */
private function replace_string($s) {
if (! is_string($s) || '' === $s || false === strpos($s, $this->from)) {
return $s;

View File

@ -1,16 +1,13 @@
<?php
// Минификация CSS: строка-безопасный минификатор + WP-CLI генерация .min.css
if (! defined('ABSPATH')) {
exit;
}
/**
* Безопасная минификация CSS: убирает комментарии, схлопывает пробелы,
* срезает пробелы вокруг { } ; , — не трогая содержимое строк/url.
*/
function dekart_minify_css(string $css): string
{
// Комментарии, кроме баннеров /*! ... */
$css = preg_replace('#/\*(?!!)[\s\S]*?\*/#', '', $css);
$out = '';
@ -67,12 +64,7 @@ function dekart_minify_css(string $css): string
return trim($out);
}
/**
* URL и версия CSS-ассета: минифицированный файл, если он сгенерирован.
*
* @param string $rel Имя файла, напр. 'main.css' или 'page-camp.css'.
* @return array{url:string,ver:int|string}
*/
function dekart_css_asset(string $rel): array
{
$dir = get_template_directory() . '/assets/css/';
@ -86,14 +78,7 @@ function dekart_css_asset(string $rel): array
}
if (defined('WP_CLI') && WP_CLI) {
/**
* Пересобирает .min.css для всех assets/css/*.css.
*
* ## EXAMPLES
* wp dekart minify-css
*
* @when after_wp_load
*/
WP_CLI::add_command('dekart minify-css', function () {
$dir = get_template_directory() . '/assets/css/';
$files = glob($dir . '*.css');

View File

@ -1,14 +1,14 @@
<?php
// Чистка построчных //-комментариев в inline-JS сниппетах плагина custom-css-js
if (! defined('ABSPATH')) {
exit;
}
// Версия чистки — меняется, если правила обновятся
const DEKART_JS_SNIPPET_MIGRATION = '006';
// Позиция //-комментария вне строковых литералов или false
function dekart_js_comment_pos($line)
{
$len = strlen($line);
@ -37,7 +37,7 @@ function dekart_js_comment_pos($line)
return false;
}
// Удаляет //-комментарии (строки и хвосты), переносы строк сохраняет
function dekart_js_strip_comments($code)
{
$parts = preg_split('/(\r\n|\n|\r)/', $code, -1, PREG_SPLIT_DELIM_CAPTURE);
@ -60,7 +60,7 @@ function dekart_js_strip_comments($code)
return $out;
}
// Разовая идемпотентная чистка (флаг в опции) — применяется при деплое темы
add_action('init', 'dekart_js_snippet_cleanup', 20);
function dekart_js_snippet_cleanup()
{

View File

@ -1,18 +1,16 @@
<?php
// Оптимизация подключения CSS сторонних плагинов (на уровне темы)
if (! defined('ABSPATH')) {
exit;
}
/**
* Есть ли на текущей странице карта (тема вставляет #ya-map на этих шаблонах).
*/
function dekart_page_has_map(): bool
{
if (is_admin()) {
return false;
}
if (is_page_template(array( 'page-contacts.php', 'page-camp.php', 'page-after-school.php' ))) {
if (is_page_template(array( 'page-contacts.php', 'page-camp.php', 'page-after-school.php', 'page-semejnye-klassy.php' ))) {
return true;
}
global $post;
@ -23,7 +21,7 @@ function dekart_page_has_map(): bool
return (bool) apply_filters('dekart_page_has_map', false);
}
// 1) SVG Support CSS не нужен: тема не стилизует .attachment/.widget_media_image svg
add_action('wp_enqueue_scripts', static function () {
if (is_admin()) {
return;
@ -31,7 +29,7 @@ add_action('wp_enqueue_scripts', static function () {
wp_dequeue_style('bodhi-svgs-attachment');
}, 100);
// 2) CSS карт/виджетов — только там, где есть карта (снимаем на остальных страницах)
add_action('wp_enqueue_scripts', static function () {
if (is_admin() || dekart_page_has_map()) {
return;
@ -40,7 +38,7 @@ add_action('wp_enqueue_scripts', static function () {
if (! $wp_styles instanceof WP_Styles) {
return;
}
// Подстроки в URL стилей карт/виджетов
$patterns = (array) apply_filters('dekart_map_css_patterns', array(
'api-maps.yandex',
'maps.yandex',

View File

@ -1,29 +1,13 @@
<?php
/**
* Schema.org JSON-LD Generator — единый @graph
*
* Генерирует микроразметку для страницы «Подготовка к школе».
* Только динамические данные из Carbon Fields. Никаких хардкод-значений.
*
* @package Dekart
* @since 2026-05-31
* @see https://schema.org/Course
*/
defined('ABSPATH') || exit;
/**
* Отключаем Yoast SEO JSON-LD на странице Подготовки к школе,
* чтобы избежать дублирования WebPage + Organization.
* Аналогично page-camp.php.
*/
add_filter('wpseo_json_ld_output', '__return_false');
/**
* Принудительно меняем og:type на 'website' для страницы Подготовки к школе,
* чтобы избежать несоответствия article/website в социальных сниппетах.
*/
add_filter('wpseo_opengraph_type', 'dekart_schema_og_type', 10, 1);
function dekart_schema_og_type(string $type): string
{
@ -33,11 +17,7 @@ function dekart_schema_og_type(string $type): string
return $type;
}
/**
* Убираем article:* OG-теги для страницы Подготовки к школе,
* чтобы не было конфликта og:type=website с article:modified_time.
* Аналог page-camp.php:15-27.
*/
add_filter('wpseo_frontend_presenter_classes', function (array $presenters): array {
if (! is_page_template('page-podgotovka-k-shkole.php')) {
return $presenters;
@ -53,16 +33,10 @@ add_filter('wpseo_frontend_presenter_classes', function (array $presenters): arr
return $presenters;
});
/**
* Главная функция: сборка @graph и вывод в wp_head.
* Срабатывает только на странице с шаблоном page-podgotovka-k-shkole.php.
*/
add_action('wp_head', 'dekart_schema_output', 1);
/**
* Возвращает URL текущей страницы для Schema.org @id.
* Динамически через get_permalink() — не зависит от хардкода ID.
*/
function dekart_schema_page_url(): string
{
$id = get_the_ID();
@ -200,14 +174,9 @@ function dekart_schema_output(): void
echo $output;
}
/* =====================================================================
Сущности @graph
===================================================================== */
/**
* WebPage — текущая страница.
* @see https://schema.org/WebPage
*/
function dekart_schema_webpage(): ?array
{
$post_id = get_the_ID();
@ -310,9 +279,7 @@ function dekart_schema_website(): ?array
);
}
/**
* BreadcrumbList — хлебные крошки для страницы.
*/
function dekart_schema_breadcrumb(): ?array
{
$page_url = dekart_schema_page_url();
@ -338,9 +305,7 @@ function dekart_schema_breadcrumb(): ?array
);
}
/**
* Helper: получить значение из Carbon Fields (schema_*) с fallback на Settings API (branch_*).
*/
function dekart_schema_option(string $schema_key, string $branch_key, $default = '')
{
$val = carbon_get_theme_option($schema_key);
@ -354,9 +319,7 @@ function dekart_schema_option(string $schema_key, string $branch_key, $default =
return $default;
}
/**
* Helper: получить значение из Настроек филиала (branch_*).
*/
function dekart_branch_option(string $key, string $default = ''): string
{
$val = get_option($key);
@ -366,9 +329,7 @@ function dekart_branch_option(string $key, string $default = ''): string
return $default;
}
/**
* Parent Organization — юридическое лицо (без адреса филиала).
*/
function dekart_schema_organization(): ?array
{
$home_url = home_url('/');
@ -404,9 +365,7 @@ function dekart_schema_organization(): ?array
return $org;
}
/**
* Helper: цепочка разрешения логотипа.
*/
function dekart_resolve_logo(): string
{
$branch_logo = get_option('branch_logo');
@ -449,10 +408,7 @@ function dekart_resolve_logo(): string
return get_template_directory_uri() . '/assets/images/logo-svg.svg';
}
/**
* OpeningHoursSpecification филиала — из CF `schema_hours`, иначе из опции `branch_hours`.
* Общий источник для LocalBusiness и главной. Пусто, если данных филиала нет.
*/
function dekart_schema_opening_hours(): array
{
$spec = array();
@ -500,7 +456,7 @@ function dekart_schema_opening_hours(): array
}
}
// Сетевой дефолт: ежедневно 08:30–20:00 (если CF филиала не заданы).
if (empty($spec)) {
foreach (array( 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ) as $day) {
$spec[] = array(
@ -514,12 +470,8 @@ function dekart_schema_opening_hours(): array
return $spec;
}
/**
* LocalBusiness — филиал/центр с адресом, телефоном.
*/
/**
* OpeningHoursSpecification из текста (напр. «пн-пт 8:30–19:00, сб 9:00–15:00»).
*/
function dekart_schema_hours_from_text($raw): array
{
$raw = is_string($raw) ? trim($raw) : '';
@ -893,10 +845,7 @@ function dekart_schema_local_business(): ?array
return $lb;
}
/**
* Course — основной курс «Подготовка к школе».
* @see https://schema.org/Course
*/
function dekart_schema_course(): ?array
{
$page_url = dekart_schema_page_url();
@ -975,9 +924,7 @@ function dekart_schema_course(): ?array
return $course;
}
/**
* AggregateRating — рейтинг из отзывов Carbon Fields.
*/
function dekart_schema_rating(): ?array
{
$page_url = dekart_schema_page_url();
@ -1011,9 +958,7 @@ function dekart_schema_rating(): ?array
);
}
/**
* Service — сущность услуги «Подготовка к школе».
*/
function dekart_schema_service(): ?array
{
$page_url = dekart_schema_page_url();
@ -1033,9 +978,7 @@ function dekart_schema_service(): ?array
);
}
/**
* FAQPage — вопросы и ответы из pksh_faq_items.
*/
function dekart_schema_faq(): ?array
{
$page_url = dekart_schema_page_url();
@ -1074,13 +1017,7 @@ function dekart_schema_faq(): ?array
);
}
/**
* Person[] — преподаватели из pksh_teachers complex.
* Каждый преподаватель — отдельная сущность Person.
* Связаны с LocalBusiness через employee @id.
*
* @return array[] Массив Person-сущностей для @graph.
*/
function dekart_schema_teachers(): array
{
$page_url = dekart_schema_page_url();
@ -1149,12 +1086,7 @@ function dekart_schema_teachers(): array
return $result;
}
/**
* Review[] — поштучные отзывы из pksh_reviews_list.
* Каждый отзыв — отдельная сущность Review с автор-персоной и оценкой.
*
* @return array[] Массив Review-сущностей для @graph.
*/
function dekart_schema_reviews(): array
{
$page_url = dekart_schema_page_url();
@ -1211,10 +1143,7 @@ function dekart_schema_reviews(): array
return $result;
}
/**
* Author Person — автор контента страницы.
* Берётся из CF полей вкладки "🤖 GEO (AI-поиск)".
*/
function dekart_schema_author(): ?array
{
$page_url = dekart_schema_page_url();
@ -1222,7 +1151,7 @@ function dekart_schema_author(): ?array
$name = $data->get_author_name();
$years = $data->get_years_on_market();
// Должность — хардкор + авто-расчёт лет
$title = 'Образовательный центр с гослицензией';
if ($years > 0) {
$title .= ', ' . $years . ' лет на рынке';
@ -1244,10 +1173,7 @@ function dekart_schema_author(): ?array
return $person;
}
/**
* Event — бесплатное пробное занятие.
* @see https://schema.org/Event
*/
function dekart_schema_trial_event(): ?array
{
if (! is_page_template('page-podgotovka-k-shkole.php')) {
@ -1315,10 +1241,7 @@ function dekart_schema_trial_event(): ?array
);
}
/**
* Offer / AggregateOffer с UnitPriceSpecification.
* @see https://schema.org/UnitPriceSpecification
*/
function dekart_schema_offer(): ?array
{
$page_url = dekart_schema_page_url();
@ -1408,9 +1331,7 @@ function dekart_schema_offer(): ?array
return $offers;
}
/**
* Парсит цену из форматированной строки (например "7 500 ₽" → 7500).
*/
function dekart_parse_price(string $raw): float
{
$clean = preg_replace('/[^0-9.,]/', '', $raw);

View File

@ -1,8 +1,6 @@
<?php
/**
* Вспомогательные функции для шаблонов
*/
if (! function_exists('render_hero_metric')) :
function render_hero_metric(array $metric): void

View File

@ -1,11 +1,11 @@
<?php
// Яндекс.Вебмастер — отправка URL на переобход
if (! defined('ABSPATH')) {
exit;
}
// Токен: константа или опция филиала
function dekart_webmaster_token()
{
if (defined('DEKART_YANDEX_WEBMASTER_TOKEN') && DEKART_YANDEX_WEBMASTER_TOKEN) {
@ -14,7 +14,7 @@ function dekart_webmaster_token()
return trim((string) get_option('branch_yandex_webmaster_token', ''));
}
// Включено только на проде и при заданном токене
function dekart_webmaster_enabled()
{
return dekart_is_prod_host() && '' !== dekart_webmaster_token();
@ -105,7 +105,7 @@ function dekart_recrawl_enqueue($url)
update_option('dekart_recrawl_queue', array_values($queue), false);
}
// Ставим URL при публикации/обновлении
add_action('save_post', 'dekart_recrawl_on_save', 20, 3);
function dekart_recrawl_on_save($post_id, $post, $update)
{
@ -165,7 +165,7 @@ function dekart_recrawl_run()
));
if (is_wp_error($r) || wp_remote_retrieve_response_code($r) >= 400) {
$failed++;
break; // ошибка/квота — стоп, остаток очереди сохраняем
break;
}
$sent++;
array_shift($left);
@ -185,7 +185,7 @@ function dekart_recrawl_run()
);
}
// Cron — только при включённой интеграции (не трогаем из CLI)
if (! ( defined('WP_CLI') && WP_CLI )) {
if (dekart_webmaster_enabled()) {
if (! wp_next_scheduled('dekart_recrawl_cron')) {

View File

@ -1,10 +1,5 @@
<?php
/*
Template Name: Шаблон страницы Лагерь
Все данные организации теперь в ACF «Настройки филиала» (меню слева, под Консолью).
Поля контента страницы (hero, about, programs, mentors, faq, etc.) — в Carbon Fields в метабоксе ниже.
*/
add_filter('wpseo_json_ld_output', '__return_false');
add_filter('wpseo_opengraph_type', function ($type) {
if (is_page_template('page-camp.php')) {
@ -25,11 +20,9 @@ add_filter('wpseo_frontend_presenter_classes', function ($presenters) {
}
return $presenters;
});
// Убираем twitter:label1 / twitter:data1 (наследие article-режима)
add_filter('wpseo_twitter_label1', '__return_empty_string');
add_filter('wpseo_twitter_data1', '__return_empty_string');
// Добавляем og:image:alt из featured image (совпадает с og:image от Yoast)
add_action('wp_head', function () {
if (! is_page_template('page-camp.php')) {
return;
@ -52,7 +45,6 @@ get_header();
$post_id = get_the_ID();
$theme_uri = get_template_directory_uri();
// ─── ДАННЫЕ ОРГАНИЗАЦИИ: ───
$opt_city_prep = get_option('branch_city_prep') ?: get_field('camp_city', $post_id) ?: carbon_get_post_meta($post_id, 'camp_city') ?: carbon_get_theme_option('site_city') ?: 'в городе';
$opt_city = get_option('branch_city') ?: carbon_get_theme_option('site_city') ?: 'городе';
$opt_region = get_option('branch_region') ?: carbon_get_theme_option('site_region') ?: 'Московская область';
@ -72,12 +64,10 @@ if (! get_option('branch_city_prep') && current_user_can('manage_options')) {
}, 1);
}
// ─── Универсальные переменные города ───
$city = $opt_city_prep;
$city_clean = $opt_city;
$city_with_prep = $opt_city_prep;
// ─── JSON-LD: ГЕО ───
$jsonld_city = $city_clean;
$jsonld_region = $opt_region;
$jsonld_addr = $opt_address ?: $jsonld_region . ', ' . $city_clean;
@ -85,15 +75,12 @@ $jsonld_coords = $opt_coords;
$jsonld_coord_arr = $jsonld_coords ? array_map('trim', explode(',', $jsonld_coords)) : array();
$jsonld_postal_code = $opt_postal;
// ─── JSON-LD: КОНТАКТЫ ───
$jsonld_phone = $opt_phone;
$jsonld_mail = $opt_email;
// ─── JSON-LD: ОРГАНИЗАЦИЯ ───
$jsonld_name = $opt_name;
$jsonld_price_range = $opt_price_range;
// ─── JSON-LD: ЛОГОТИП (ACF option → WP Customizer fallback) ───
if ($opt_logo && is_array($opt_logo)) {
$jsonld_img_url = $opt_logo['url'] ?? '';
} elseif ($opt_logo) {
@ -106,7 +93,6 @@ if (! $jsonld_img_url) {
$jsonld_img_url = $logo_id ? wp_get_attachment_url($logo_id) : '';
}
// ─── JSON-LD: СОЦСЕТИ ───
$jsonld_social = array();
if (is_array($opt_social_raw)) {
foreach ($opt_social_raw as $s) {
@ -116,7 +102,6 @@ if (is_array($opt_social_raw)) {
}
}
// ─── Поля контента страницы (остаются per-page) ───
$priceMin = (int) carbon_get_post_meta($post_id, 'price_half_day');
?>
@ -382,7 +367,6 @@ $metrics = [
<span class="programs__duration">за <?php echo esc_html($programs_days); ?></span>
</div>
<?php
// Понижаем H3→H4, удаляем пустые заголовки (защита от редактора)
$programs_fixed = preg_replace('/<h3\b([^>]*)>/i', '<h4$1>', $programs_content);
$programs_fixed = preg_replace('/<\/h3>/i', '</h4>', $programs_fixed);
$programs_fixed = preg_replace('/<h4[^>]*>\s*<\/h4>/i', '', $programs_fixed);
@ -858,9 +842,7 @@ $metrics = [
<?php
// ─────────────────────────────────────────────────────────────
// JSON-LD: Event (смены) + FAQ + AggregateRating (отзывы)
// ─────────────────────────────────────────────────────────────
$programs = carbon_get_post_meta($post_id, 'programs');
$ld_events = array();
if (is_array($programs)) {
@ -888,7 +870,6 @@ if (is_array($programs)) {
// DD.MM.YYYY
} elseif (preg_match('/(\d{2})\.(\d{2})\.(\d{4})/', $raw, $m)) {
$ev['startDate'] = $m[3] . '-' . $m[2] . '-' . $m[1];
// Русские месяцы: "26–30 мая 2025" или "30 июня–4 июля 2025"
} elseif (
preg_match('/(\d{1,2})\s*(?:[–—\-]|\s*–\s*)\d{1,2}\s+([а-яё]+)/ui', $raw, $m)
|| preg_match('/(\d{1,2})\s+([а-яё]+)\s*[–—\-]/ui', $raw, $m)

View File

@ -1,16 +1,5 @@
<?php
/**
* Template Name: Класс начальной школы
*
* Универсальный шаблон лендинга для классов начальной школы (1–4).
* Все данные страницы управляются через Carbon Fields (вкладки «Настройки Страницы Класса»):
* 🖼️ HERO, 📚 Программа, 👨‍🏫 Преподаватели, 🗓 Расписание и стоимость,
* 💬 Отзывы, ❓ FAQ, 📊 SEO.
* Глобальные секции (контакты) и данные филиала (телефон, адрес, цена) —
* из настроек филиала (branch_*).
*
* @package Dekart
*/
if (! defined('ABSPATH')) {
exit;
@ -52,7 +41,6 @@ $class_modified = get_the_modified_time('c', $post_id);
</main>
<?php
// ─── Schema.org @graph ───
$graph = array();
$graph[] = array(

View File

@ -1,7 +1,5 @@
<?php
/*
Template Name: Шаблон страницы Контакты
*/
?>
<?php
get_header();

View File

@ -1,7 +1,5 @@
<?php
/*
Template Name: Шаблон страницы все курсы
*/
?>
<?php
get_header();

View File

@ -1,7 +1,5 @@
<?php
/*
Template Name: Начальная школа (Elementary School)
*/
?>
<?php
get_header();
@ -66,7 +64,7 @@ $page_breadcrumbs = carbon_get_post_meta($post_id, 'page_breadcrumbs');
$school_published = get_the_date('c', $post_id);
$school_modified = get_the_modified_time('c', $post_id);
// Данные филиала из CF/опций (без хардкода)
$branch_name = get_option('branch_name') ?: carbon_get_theme_option('site_name') ?: '';
$branch_city = get_option('branch_city') ?: carbon_get_theme_option('site_city') ?: '';
$branch_city_prep = get_option('branch_city_prep') ?: ( $branch_city ? 'в ' . $branch_city : '' );

View File

@ -1,7 +1,5 @@
<?php
/*
Template Name: Шаблон страницы Фото центра
*/
?>
<?php
get_header();

View File

@ -1,7 +1,5 @@
<?php
/*
Template Name: Шаблон страницы Новости
*/
?>
<?php
get_header();

View File

@ -1,7 +1,5 @@
<?php
/*
Template Name: Шаблон страницы Сведения об образовательной организации
*/
?>
<?php
get_header();

View File

@ -1,7 +1,5 @@
<?php
/*
* Template Name: Подготовка к школе (2026)
*/
if (! defined('ABSPATH')) {
exit;

View File

@ -1,16 +1,12 @@
<?php
/**
* Template Name: Программа — Подготовка к школе (служебная)
*
* @package Dekart
*/
if (! defined('ABSPATH')) {
exit;
}
// Подключаем CSS напрямую в head (надёжнее ранних хуков)
add_action('wp_head', function () {
$css_url = get_template_directory_uri() . '/assets/css/program-pksh.css';
$css_path = get_template_directory() . '/assets/css/program-pksh.css';

View File

@ -1,15 +1,6 @@
<?php
/**
* Template Name: Шаблон страницы Отзывы
*
* Контент секций — Carbon Fields (post_meta).
* Данные филиала (город, телефон, адрес) — get_option('branch_*')
* с fallback на carbon_get_theme_option('site_*').
* Отзывы — Carbon Fields complex (reviews_cards) с пагинацией.
*
* @package Dekart
*/
add_filter('wpseo_json_ld_output', '__return_false');
add_filter('wpseo_opengraph_type', function ($type) {
@ -123,13 +114,12 @@ $results_items = carbon_get_post_meta($post_id, 'reviews_results');
$faq_items = carbon_get_post_meta($post_id, 'reviews_faq');
$faq_title = carbon_get_post_meta($post_id, 'reviews_faq_title');
// Финальный CTA — из CF (без авто-расчёта дат)
$final_academic_year = (string) carbon_get_post_meta($post_id, 'reviews_final_academic_year');
$final_openday_date = (string) carbon_get_post_meta($post_id, 'reviews_final_openday_date');
$branch_button_script = get_option('branch_button_script', '');
// Парсинг Bitrix24 параметров для динамической загрузки (иначе не инициализируется в скрытой модалке)
$_b24_form = '';
$_b24_url = '';
if (preg_match('/data-b24-form="([^"]+)"/', $branch_button_script, $_m)) {
@ -200,7 +190,6 @@ if (is_array($branch_messengers)) {
$jsonld_social = array_values(array_unique($jsonld_social));
// H1 из заголовка страницы (Yoast), fallback — из названия филиала
$reviews_h1 = get_post_meta($post_id, '_yoast_wpseo_title', true);
if ('' === (string) $reviews_h1) {
$reviews_h1 = sprintf('Отзывы о частной школе «%s» %s', $branch_name, $branch_city_prep);
@ -284,7 +273,6 @@ if ('' === (string) $reviews_h1) {
<?php if (has_post_thumbnail()) : ?>
<div class="reviews-hero__visual">
<!-- Purple glow backdrop (адаптирован под тёмный фон hero) -->
<div class="reviews-hero__visual-glow" aria-hidden="true"></div>
<!-- Photo with frame + ring -->
@ -301,7 +289,6 @@ if ('' === (string) $reviews_h1) {
<div class="reviews-hero__photo-ring" aria-hidden="true"></div>
</div>
<!-- Floating badges — из Carbon Fields (reviews_hero_badges) -->
<?php if (! empty($hero_badges) && is_array($hero_badges)) : ?>
<?php foreach ($hero_badges as $i => $badge) :
$bi = $i + 1; // 1-indexed for CSS class
@ -1144,7 +1131,6 @@ $ld_reviews = array();
$agg_total_stars = 0;
$agg_review_cnt = 0;
// Разметка по тем же карточкам, что видны на странице (reviews_cards)
$schema_cards = carbon_get_post_meta($post_id, 'reviews_cards');
if (! is_array($schema_cards)) {
$schema_cards = array();
@ -1187,7 +1173,7 @@ foreach ($schema_cards as $card) {
$agg_review_cnt++;
}
// datePublished: дата из карточки (ДД.ММ.ГГГГ → ISO)
$review_date_cf = isset($card['review_date']) ? trim((string) $card['review_date']) : '';
if ('' !== $review_date_cf) {
if (preg_match('/^(\d{2})\.(\d{2})\.(\d{4})$/', $review_date_cf, $m)) {
@ -1235,7 +1221,6 @@ if (! empty($faq_items) && is_array($faq_items)) {
}
}
// Небрендовый FAQ — тот же набор, что виден в блоке .reviews-nonbrand
$nb_faq_schema = carbon_get_post_meta($post_id, 'reviews_nonbrand_faq');
if (! empty($nb_faq_schema) && is_array($nb_faq_schema)) {
foreach ($nb_faq_schema as $item) {

View File

@ -7,7 +7,7 @@ if (! defined('ABSPATH')) {
exit;
}
// OG: website (не article) + изображение из CF
add_filter('wpseo_opengraph_type', function ($type) {
return is_page_template('page-semejnye-klassy.php') ? 'website' : $type;
});
@ -53,7 +53,6 @@ get_header();
get_template_part('template-parts/family/classes');
get_template_part('template-parts/family/photos');
// Педагоги — выбранные в CF (пусто → все, как на странице школы)
get_template_part('template-parts/teachers-cards', null, array(
'teacher_ids' => $fam_teacher_ids,
'title' => $fam_teacher_title ?: 'Педагоги, которые работают в формате',
@ -65,7 +64,7 @@ get_header();
get_template_part('template-parts/family/price');
get_template_part('template-parts/family/compare');
// Отзывы — выбранные в CF (пусто → общие школьные)
get_template_part('template-parts/reviews-link', null, array(
'ids' => $fam_review_ids,
'title' => $fam_reviews_title,

View File

@ -1,7 +1,5 @@
<?php
/*
Template Name: Шаблон страницы Наши преподаватели
*/
?>
<?php
get_header();

View File

@ -1,7 +1,5 @@
<?php
/*
Template Name: Шаблон страницы Вакансии
*/
?>
<?php
get_header();

View File

@ -199,7 +199,7 @@ $current_term = $tags[0];
?>
</p>
<?php
// Параметры запроса к базе данных
$teachers_args = array(
'posts_per_page' => -1,
@ -209,20 +209,19 @@ $current_term = $tags[0];
'meta_query' => array(
array(
'key' => 'select_courses',
'carbon_field_property' => 'id', //Ключевое в условии meta_query указать этот параметр
'carbon_field_property' => 'id',
'compare' => '==',
'value' => $post_id,
),
),
);
// Получение списка преподавателей
$teachers = get_posts($teachers_args);
?>
<div class="swiper teachers-owl">
<div class='swiper-wrapper'>
<?php foreach ($teachers as $teacher) :
setup_postdata($teacher);
//var_dump(carbon_get_post_meta( $teacher->ID, 'select_courses' ));
?>
<div class="swiper-slide teachers-owl_item">
<div class="ourteacher-avatar">

View File

@ -1,11 +1,5 @@
<?php
/**
* Личная страница преподавателя (Bento 2026).
*
* Данные — из CF карточки преподавателя.
*
* @package Dekart
*/
if (! defined('ABSPATH')) {
exit;
@ -30,7 +24,6 @@ get_header();
$tid = (int) get_the_ID();
$full_name = get_the_title($tid);
// ─── Гео / контакты филиала ───
$branch_phone = get_option('branch_phone') ?: carbon_get_theme_option('site_phone');
$branch_city = get_option('branch_city') ?: carbon_get_theme_option('site_city', 'Щёлково');
$branch_city_prep = get_option('branch_city_prep', 'в Щёлково') ?: 'в Щёлково';
@ -58,7 +51,6 @@ if ('' === $wa_number && $phone_clean) {
}
$wa_url = ('' !== $wa_number) ? 'https://wa.me/' . $wa_number : '';
// ─── Профиль преподавателя (CF) ───
$direction = carbon_get_post_meta($tid, 'teacher_direction');
$subj = $direction;
$badge = carbon_get_post_meta($tid, 'teacher_badge');
@ -142,7 +134,6 @@ if ('' === $hero_subtitle) {
$hero_subtitle = ( $subj ? $subj : 'Обучение' ) . ' — мини-группы ' . $group_size . ' чел. · ' . $exam_label . ' · школа «' . $branch_name . '» ' . $branch_city_prep;
}
// ─── Шаги «Как проходит первое занятие» ───
$steps = (array) carbon_get_post_meta($tid, 'teacher_steps');
if (empty($steps) || ! is_array($steps)) {
$steps = array(
@ -154,7 +145,6 @@ if (empty($steps) || ! is_array($steps)) {
);
}
// ─── Сегменты «Для кого» ───
$segments = (array) carbon_get_post_meta($tid, 'teacher_segments');
if (empty($segments) || ! is_array($segments)) {
$segments = array(
@ -166,10 +156,8 @@ if (empty($segments) || ! is_array($segments)) {
$segment_4_title = 'Уже занимались с репетитором, но нет результата?';
$segment_4_text = 'Частая ситуация: деньги потрачены, а результата нет. В мини-группе другой механизм — соревнование, методика и куратор. Приходите на бесплатную диагностику и сравните сами.';
// ─── Кейсы (табы) ───
$cases = (array) carbon_get_post_meta($tid, 'teacher_cases');
// ─── FAQ: формат + общие вопросы ───
$faq_extra = (array) carbon_get_post_meta($tid, 'teacher_faq_extra');
$faq_items = array();
if (empty($faq_extra)) {
@ -195,8 +183,7 @@ foreach ($legacy_questions as $lq) {
}
}
// ─── Дни до экзамена (полоса дефицита) ───
// Сегодня=0, завтра=1, прошлое=скрыто
$days_left = '';
if ($exam_date && preg_match('/^\d{4}-\d{2}-\d{2}$/', $exam_date)) {
$tz = wp_timezone();
@ -208,7 +195,6 @@ if ($exam_date && preg_match('/^\d{4}-\d{2}-\d{2}$/', $exam_date)) {
}
}
// ─── Микроразметка (единый @graph) ───
// Пустые свойства не выводим
$teachers_page = get_page_by_path('our-teachers');
@ -268,7 +254,6 @@ if (! empty($org_license)) {
);
}
// Внешние профили организации (Яндекс Бизнес, 2ГИС, Google, соцсети)
$org_sameas = array();
foreach (array(
get_option('branch_yandex_business_url'),
@ -306,7 +291,7 @@ foreach ((array) get_option('branch_programs', array()) as $bp) {
$teacher_subjects = (array) carbon_get_post_meta($tid, 'teacher_subjects');
$subject_items = array(); // без дубликатов
foreach ($teacher_subjects as $ts) {
// Название: CF-select «Программа» → легаси select_direction
$sn = $ts['teacher_subjects_title'] ?? '';
if (is_array($sn)) {
$sn = reset($sn);
@ -342,14 +327,12 @@ foreach ($teacher_subjects as $ts) {
}
$subject_names = array_values(array_unique(array_map(function ($it) { return $it['name']; }, $subject_items)));
// ─── Данные филиала ───
$branch_price = get_option('branch_price');
$branch_geo_areas = get_option('branch_area_served');
$geo_walk = get_option('branch_logistics_walk');
$geo_parking = get_option('branch_logistics_parking');
$geo_schools = get_option('branch_logistics_schools');
// ─── Результаты: CF или авто ───
$cf_results = carbon_get_post_meta($tid, 'teacher_results');
$results = array();
if (is_array($cf_results) && ! empty($cf_results)) {
@ -397,7 +380,7 @@ $sp_avg_num = function_exists('dekart_teacher_review_avg')
$sp_avg = $sp_avg_num > 0 ? number_format($sp_avg_num, 1, '.', '') : '';
$rating_num = $sp_avg_num > 0 ? $sp_avg_num : ( is_numeric($rating) ? (float) $rating : 0.0 );
// E-E-A-T: образование, гео, место работы
$cred_name = trim((string) carbon_get_post_meta($tid, 'teacher_credential'));
if ('' === $cred_name) {
$cred_name = trim((string) carbon_get_post_meta($tid, 'teacher_education'));
@ -447,7 +430,7 @@ if (! empty($person_sameas)) {
$person['sameAs'] = array_values(array_unique($person_sameas));
}
// ── Course (предмет + мини-группа) ──
// Person/Org один раз (@id)
$build_course = function ( $name, $cid, $availability = null, $description = '', $price = '' ) use ( $page_url, $org_id, $person_id, $group_size, $full_name, $branch_price ) {
$course = array(
@ -468,7 +451,7 @@ $build_course = function ( $name, $cid, $availability = null, $description = '',
'category' => 'Мини-группа ' . $group_size . ' человек',
),
);
// Цена — микроразметка; число из строки
$offer_price = ( '' !== (string) $price ) ? $price : $branch_price;
$offer_price_norm = preg_replace('/\s+/u', '', (string) $offer_price);
if (preg_match('/\d+(?:[.,]\d+)?/', $offer_price_norm, $pm)) {
@ -499,7 +482,6 @@ if (! empty($subject_items)) {
$courses[] = $build_course('Занятия в мини-группе ' . $group_size . ' чел.', 1);
}
// ── Рейтинг и отзывы — на Course (Person не поддержан Google) ──
if ($sp_avg_num > 0 && $review_count > 0 && ! empty($courses)) {
$courses[0]['aggregateRating'] = array(
'@type' => 'AggregateRating',
@ -508,7 +490,7 @@ if ($sp_avg_num > 0 && $review_count > 0 && ! empty($courses)) {
'bestRating' => '5',
);
// Единый источник отзывов — тот же, что видимый блок
$teacher_reviews = function_exists('dekart_teacher_review_ids') ? dekart_teacher_review_ids($tid) : array();
$review_items = array();
foreach ($teacher_reviews as $rid) {
@ -570,7 +552,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<main class="teacher-single">
<?php
// ─── HERO ───
?>
<section class="section-bg ds-hero teacher-single__hero" data-bg="hero" aria-labelledby="teacher-single-title">
<div class="ds-container">
@ -665,8 +646,7 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
</section>
<?php
// ─── ЦИФРЫ ───
// Только CF teacher_metrics; пусто — скрыта
$metrics = array();
$metric_cards = (array) carbon_get_post_meta($tid, 'teacher_metrics');
if (! empty($metric_cards) && is_array($metric_cards)) {
@ -700,7 +680,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php endif; ?>
<?php
// ─── ПОЛОСА ДЕФИЦИТА ───
if ($days_left !== '' || ( $seats_left && (int) $seats_left > 0 )) :
?>
<section class="teacher-single__scarcity section-bg reveal" data-bg="teacher-scarcity" aria-label="Осталось мест">
@ -727,8 +706,7 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php endif; ?>
<?php
// ─── ОБРАЗОВАНИЕ / СЕРТИФИКАТЫ ───
// Направления — в секции программ
$certificates = (array) carbon_get_post_meta($tid, 'certificates');
if ($education || $add_education || ! empty($certificates)) :
?>
@ -782,7 +760,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php endif; ?>
<?php
// ─── О СЕБЕ / ПЕРВОЕ ЗАНЯТИЕ ───
if ($about_text) :
?>
<section class="teacher-single__story section-bg reveal" data-bg="teacher-story" aria-labelledby="teacher-story-title">
@ -822,7 +799,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php if (! empty($subject_items)) : ?>
<?php
// ─── ПРОГРАММЫ ───
// Якорь #course-N = @id
?>
<section class="teacher-single__courses section-bg reveal" data-bg="teacher-courses" aria-labelledby="teacher-courses-title">
@ -868,7 +844,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php endif; ?>
<?php
// ─── СОЦИАЛЬНОЕ ДОКАЗАТЕЛЬСТВО ───
// Рейтинг: $sp_avg; школа — опции
$branch_avg = (string) get_option('branch_avg_rating', '');
$branch_cnt = (string) get_option('branch_ext_review_count', '');
@ -906,7 +881,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php endif; ?>
<?php
// ─── СЕГМЕНТЫ ───
?>
<section class="teacher-single__segments section-bg reveal" data-bg="teacher-segments" aria-labelledby="teacher-segments-title">
<div class="container">
@ -949,7 +923,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
</section>
<?php
// ─── РЕЗУЛЬТАТЫ ───
if (! empty($results)) :
?>
<section class="teacher-single__results section-bg reveal" data-bg="teacher-results" aria-labelledby="teacher-results-title">
@ -990,7 +963,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php endif; ?>
<?php
// ─── КЕЙСЫ ───
$case_tabs = array();
if (! empty($cases) && is_array($cases)) {
$case_tabs = array_values(array_unique(array_filter(array_map(function ($c) {
@ -1034,7 +1006,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php endif; ?>
<?php
// ─── FAQ ───
if (! empty($faq_items)) :
?>
<section class="teacher-single__faq section-bg reveal" data-bg="teacher-faq" aria-labelledby="teacher-faq-title">
@ -1053,7 +1024,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php endif; ?>
<?php
// ─── ОТЗЫВЫ ───
$show_social_reviews = carbon_get_post_meta($tid, 'teacher_show_social_reviews');
if ('no' !== (string) $show_social_reviews) {
get_template_part('template-parts/reviews-link', null, array( 'teacher' => $tid ));
@ -1061,7 +1031,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
?>
<?php
// ─── ДОВЕРИЕ / ЛИЦЕНЗИЯ ───
?>
<section class="teacher-single__trust section-bg reveal" data-bg="teacher-trust" aria-labelledby="teacher-trust-title">
<div class="container">
@ -1076,7 +1045,7 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
</section>
<?php
// другие преподаватели: 4 карточки, без текущего
get_template_part('template-parts/teachers-cards', null, array(
'exclude' => get_the_ID(),
'limit' => 4,
@ -1084,7 +1053,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
?>
<?php
// ─── ГЕО ───
$geo_items = array();
if ('' !== (string) $branch_geo_areas) {
foreach (array_map('trim', explode(',', $branch_geo_areas)) as $ga) {
@ -1128,7 +1096,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
<?php endif; ?>
<?php
// ─── ФИНАЛЬНЫЙ CTA ───
?>
<section class="teacher-single__final section-bg reveal" data-bg="teacher-final" aria-labelledby="teacher-final-title">
<div class="container">
@ -1151,10 +1118,8 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
</section>
<?php
// ─── КОНТАКТЫ / АДРЕС ───
get_template_part('template-parts/contacts');
// ─── ЭКСПЕРТНОСТЬ ───
$teacher_creds = trim(implode(', ', array_filter(array(
$direction ?: '',
($tenure ? 'педагогический стаж ' . $tenure . ' ' . dekart_years_plural((int) $tenure) : ''),
@ -1166,7 +1131,6 @@ $schema_graph[] = array('@type' => 'BreadcrumbList', 'itemListElement' => $bread
?>
<?php
// ─── STICKY CTA ───
?>
<div class="teacher-single__sticky" hidden>
<div class="teacher-single__sticky-inner">

View File

@ -70,7 +70,7 @@ if (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|
'terms' => $term_id,
),
),
'posts_per_page' => -1, // Количество записей (-1 = все записи)
'posts_per_page' => -1,
);
$query = new WP_Query($args);

View File

@ -8,11 +8,10 @@ if (! defined('ABSPATH')) {
$post_id = get_the_ID();
// ── Поддержка $args (переопределение автора, напр. для single-teacher) ──
$args = isset($args) && is_array($args) ? $args : array();
$args = wp_parse_args($args, array('author_name' => '', 'author_creds' => ''));
// ── Автор: $args → Settings API → fallback ──
$author_name = $args['author_name']
?: get_option('branch_director_name', 'Елена Сергеевна Дегтярёва')
?: carbon_get_post_meta($post_id, 'pksh_author_name')
@ -21,7 +20,7 @@ $author_name = $args['author_name']
$author_creds = $args['author_creds']
?: get_option('branch_director_creds', 'директор частной школы «Декарт», педагогический стаж 18 лет');
// ── Даты (автоматически из WP) ──
$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)) : '';

View File

@ -11,7 +11,7 @@ foreach ($social_media as $item) {
continue;
}
// Имя ссылки: из CF, иначе из домена
$name = trim((string) ($item['social_media_name'] ?? ''));
if ('' === $name) {
$name = (string) preg_replace('#^www\.#', '', (string) wp_parse_url($link, PHP_URL_HOST));

View File

@ -56,8 +56,8 @@ $default_rows = array(
?>
<div class="comparison__row">
<div class="comparison__cell comparison__cell--param"><?php echo esc_html($param); ?></div>
<div class="comparison__cell comparison__cell--dekart"><?php echo $check_svg . ' ' . esc_html($dekart_text); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<div class="comparison__cell comparison__cell--state"><?php echo $cross_svg . ' ' . esc_html($state_text); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<div class="comparison__cell comparison__cell--dekart"><?php echo $check_svg . ' ' . esc_html($dekart_text); ?></div>
<div class="comparison__cell comparison__cell--state"><?php echo $cross_svg . ' ' . esc_html($state_text); ?></div>
</div>
<?php endforeach; ?>
</div>

View File

@ -1,6 +1,5 @@
<?php
// Сравнение форматов обучения (школа / семейный класс / онлайн)
if (! defined('ABSPATH')) {
exit;
@ -10,7 +9,7 @@ $title = dekart_family_get('family_compare_title');
$text = dekart_family_get('family_compare_text');
$rows = dekart_family_get('family_compare_rows');
// Только строки с заполненным параметром
$rows = array_values(array_filter((array) $rows, function ($r) {
return is_array($r) && trim((string) ($r['param'] ?? '')) !== '';
}));

View File

@ -1,6 +1,6 @@
<?php
// Hero (тёмный, система ds-hero — как на других страницах)
if (! defined('ABSPATH')) {
exit;
@ -56,24 +56,31 @@ $f_hours = get_option('branch_work_hours') ?: get_option('branch_hours');
</div>
<?php
// Фото hero — из «Изображения записи» страницы (штатное WP), адаптивно (srcset/sizes)
$f_thumb_id = get_post_thumbnail_id(get_the_ID());
$f_thumb_url = $f_thumb_id ? (string) wp_get_attachment_image_url($f_thumb_id, 'large') : '';
$f_thumb_alt = $f_thumb_id ? (string) get_post_meta($f_thumb_id, '_wp_attachment_image_alt', true) : '';
if ($f_thumb_url) :
$f_thumb_id = get_post_thumbnail_id(get_the_ID());
if ($f_thumb_id) :
$f_src = wp_get_attachment_image_src($f_thumb_id, 'large');
$f_srcset = wp_get_attachment_image_srcset($f_thumb_id, 'large');
$f_sizes = '(max-width: 860px) 92vw, 600px';
?>
$f_alt = (string) get_post_meta($f_thumb_id, '_wp_attachment_image_alt', true);
$f_sizes = '(max-width: 860px) 92vw, 588px';
$f_avif = function_exists('dekart_format_srcset') ? dekart_format_srcset($f_thumb_id, 'avif') : '';
$f_webp = function_exists('dekart_format_srcset') ? dekart_format_srcset($f_thumb_id, 'webp') : '';
$f_url = $f_src ? (string) $f_src[0] : '';
if ($f_url) :
?>
<div class="family-hero__media">
<img src="<?php echo esc_url($f_thumb_url); ?>"
<?php if ($f_srcset) : ?>srcset="<?php echo esc_attr($f_srcset); ?>" sizes="<?php echo esc_attr($f_sizes); ?>"<?php endif; ?>
alt="<?php echo esc_attr($f_thumb_alt ?: $f_h1); ?>"
width="<?php echo esc_attr($f_src ? (int) $f_src[1] : 900); ?>"
height="<?php echo esc_attr($f_src ? (int) $f_src[2] : 600); ?>"
loading="eager" fetchpriority="high" decoding="async">
<picture>
<?php if ($f_avif) : ?><source type="image/avif" srcset="<?php echo esc_attr($f_avif); ?>" sizes="<?php echo esc_attr($f_sizes); ?>"><?php endif; ?>
<?php if ($f_webp) : ?><source type="image/webp" srcset="<?php echo esc_attr($f_webp); ?>" sizes="<?php echo esc_attr($f_sizes); ?>"><?php endif; ?>
<img src="<?php echo esc_url($f_url); ?>"
<?php if ($f_srcset) : ?>srcset="<?php echo esc_attr($f_srcset); ?>" sizes="<?php echo esc_attr($f_sizes); ?>"<?php endif; ?>
alt="<?php echo esc_attr($f_alt ?: $f_h1); ?>"
width="<?php echo esc_attr($f_src ? (int) $f_src[1] : 900); ?>"
height="<?php echo esc_attr($f_src ? (int) $f_src[2] : 600); ?>"
loading="eager" fetchpriority="high" decoding="async">
</picture>
</div>
<?php endif; ?>
<?php endif;
endif; ?>
</div>
</div>
</section>

View File

@ -1,6 +1,6 @@
<?php
// Перелинковка лендинга «Семейные классы» с кластером
if (! defined('ABSPATH')) {
exit;
@ -9,7 +9,7 @@ if (! defined('ABSPATH')) {
$title = dekart_family_get('family_links_title');
$links = dekart_family_get('family_links');
// Дефолт: перелинковка со школой и кластером (если CF пуст)
if (! $links) {
$school_id = function_exists('dekart_page_id_by_template') ? dekart_page_id_by_template('page-elementary-school.php') : 0;
$school_url = $school_id ? get_permalink($school_id) : '/nachalnaya-shkola/';

View File

@ -1,6 +1,6 @@
<?php
// Фото-секции лендинга (до 2, опционально)
if (! defined('ABSPATH')) {
exit;

View File

@ -1,6 +1,5 @@
<?php
// Стоимость — из CF главной (price_cards, как секция «Стоимость обучения…»)
if (! defined('ABSPATH')) {
exit;
@ -9,7 +8,6 @@ if (! defined('ABSPATH')) {
$f_title = dekart_family_get('family_price_title');
$f_note = dekart_family_get('family_price_note');
// Источник CF: 1) страница школы (price_cards), 2) фолбэк — главная
$src_id = 0;
$cards = array();

View File

@ -1,6 +1,5 @@
<?php
// Schema.org @graph (WebPage / BreadcrumbList / Organization / FAQPage)
if (! defined('ABSPATH')) {
exit;
@ -39,7 +38,7 @@ $f_graph[] = array(
),
);
// Организация/филиал — из общих хелперов (данные филиала)
if (function_exists('dekart_schema_organization')) {
$f_org = dekart_schema_organization();
if ($f_org) {
@ -53,7 +52,6 @@ if (function_exists('dekart_schema_local_business')) {
}
}
// Course + Offer (цены из CF школы), CourseInstance (Onsite, адрес филиала)
$f_price_cards = array();
$f_school_id = function_exists('dekart_page_id_by_template') ? dekart_page_id_by_template('page-elementary-school.php') : 0;
if ($f_school_id) {
@ -134,7 +132,6 @@ if ($f_offers) {
$f_course['offers'] = $f_offers;
}
// Отзывы — те же, что видны на странице (CF лендинга или школьные)
$f_reviews = array();
$f_review_ids = function_exists('dekart_assoc_ids') ? dekart_assoc_ids(dekart_family_get('family_review_ids')) : array();
if ($f_review_ids) {
@ -152,7 +149,6 @@ if ($f_review_ids) {
} else {
$f_school_cards = carbon_get_post_meta(91, 'reviews_cards');
if (is_array($f_school_cards) && $f_school_cards) {
// Тот же набор, что виден в блоке: сортировка по дате + лимит 3
if (function_exists('dekart_reviews_sort_desc')) {
$f_school_cards = dekart_reviews_sort_desc($f_school_cards);
}

View File

@ -1,6 +1,5 @@
<?php
// Блок «Коротко» — самодостаточный прямой ответ (для AEO/сниппетов)
if (! defined('ABSPATH')) {
exit;

View File

@ -16,7 +16,6 @@ $internal_links = array(
array( 'url' => home_url('/kontakty/'), 'label' => 'Контакты и адрес', 'text' => 'Как добраться и записаться на экскурсию' ),
);
// Ссылка на лендинг «Семейные классы» (если страница существует)
$fam_url = function_exists('dekart_family_classes_url') ? dekart_family_classes_url() : '';
if ($fam_url) {
array_unshift($internal_links, array(

View File

@ -36,7 +36,7 @@ $platforms = array(
),
);
// Фильтруем: только площадки с заполненной ссылкой
$active = array_filter($platforms, function ($p) {
return ! empty($p['url']);
});

View File

@ -44,8 +44,8 @@ $faq_items = $data->get_faq_items();
if (! empty($col1) || ! empty($col2)) :
?>
<div class="faq-section__wrapper">
<div class="faq-section__col"><?php echo $col1; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<div class="faq-section__col"><?php echo $col2; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<div class="faq-section__col"><?php echo $col1; ?></div>
<div class="faq-section__col"><?php echo $col2; ?></div>
</div>
<?php endif;
endif; ?>

View File

@ -1,5 +1,4 @@
<?php
// Секция цен (главная/школа) — с параметрами для лендингов формата
$post_id = isset($args['post_id']) ? (int) $args['post_id'] : get_the_ID();
$pf_label = isset($args['label']) ? (string) $args['label'] : 'Стоимость';
$pf_title = isset($args['title']) ? (string) $args['title'] : 'Стоимость обучения в частной школе «Декарт»';

View File

@ -1,6 +1,6 @@
<?php
// Ссылка на сведения об организации
if (! defined('ABSPATH')) {
return;

View File

@ -1,6 +1,6 @@
<?php
// Ознакомление с программой в офисе
if (! defined('ABSPATH')) {
exit;

View File

@ -20,7 +20,6 @@ $head_desc = ( $__rd_rating && $__rd_count )
unset($__rd_rating, $__rd_count);
if ($teacher_filter) {
// Отзывы преподавателя — единый источник (dekart_teacher_review_ids)
$teacher_ids = function_exists('dekart_teacher_review_ids') ? dekart_teacher_review_ids($teacher_filter) : array();
$has_reviews = ! empty($teacher_ids);
$reviews_cards = array();

View File

@ -1,6 +1,5 @@
<?php
// Формирование заголовка и параметров запроса в зависимости от переданных аргументов
$title = 'Отзывы';
$key = [];
@ -41,7 +40,7 @@ if (isset($args['teacher'])) {
}
}
// Подготовка аргументов для запроса отзывов
$query_args = [
'posts_per_page' => -1,
'post_type' => 'reviews',

View File

@ -14,7 +14,7 @@ if (empty($fam_links) || ! is_array($fam_links)) {
];
}
// Гарантируем ссылку со школы на лендинг «Семейные классы»
if ($fam_url) {
$has_fam = false;
foreach ($fam_links as $fl) {

View File

@ -15,7 +15,7 @@ $prices = array(
'clubs' => get_option('branch_price_clubs', ''),
);
// Внешний сайт ЕГЭ/ОГЭ филиала ({branch}.dekart-school.ru)
$exam_host = (string) wp_parse_url(home_url('/'), PHP_URL_HOST);
$exam_url = ( $exam_host && str_ends_with($exam_host, '.dekart.school') )
? 'https://' . preg_replace('/\.dekart\.school$/', '.dekart-school.ru', $exam_host) . '/'

View File

@ -1,6 +1,5 @@
<?php
// Секция преподавателей (блок на страницах) — карточка общая с /our-teachers/
if (! defined('ABSPATH')) {
exit;
@ -34,7 +33,7 @@ if (! empty($teacher_ids)) {
}
$teachers_query = new WP_Query($query_args);
// Отмеченные «первыми» — в начало
$teachers_query->posts = dekart_teachers_reorder_pinned($teachers_query->posts);
?>
<section class="bento teachers-cards" id="teachers" aria-label="Преподаватели">

View File

@ -15,7 +15,7 @@ $sc_teachers = get_query_var('sc_teachers');
<?php endif; ?>
<?php
// Параметры запроса к базе данных
$teachers_args = array(
'posts_per_page' => $count,
'orderby' => 'date',
@ -26,7 +26,7 @@ $sc_teachers = get_query_var('sc_teachers');
'update_post_term_cache' => false,
);
// Получение списка преподавателей
$teachers = dekart_teachers_reorder_pinned(get_posts($teachers_args));
?>

View File

@ -1,6 +1,6 @@
<?php
// Карточка преподавателя — общий шаблон
if (! defined('ABSPATH')) {
exit;
@ -11,7 +11,7 @@ if (! $tid) {
return;
}
// CTA карточки (можно переопределить на лендингах формата)
$cta_label = isset($args['cta_label']) && $args['cta_label'] !== '' ? (string) $args['cta_label'] : 'Записаться к преподавателю';
$cta_goal = isset($args['cta_goal']) && $args['cta_goal'] !== '' ? (string) $args['cta_goal'] : 'teacher_card_form';
@ -29,6 +29,7 @@ $start_year = carbon_get_post_meta($tid, 'teacher_start_year');
$rating = carbon_get_post_meta($tid, 'teacher_rating');
$avatar_id = carbon_get_post_meta($tid, 'teacher_avatar');
$avatar_url = $avatar_id ? wp_get_attachment_url($avatar_id) : '';
$avatar_srcset = $avatar_id ? (string) wp_get_attachment_image_srcset($avatar_id, 'medium_large') : '';
$tenure = '';
if ($start_year && absint($start_year) > 1900) {
@ -61,7 +62,6 @@ if ('' === $link_anchor) {
$link_anchor = 'Подробнее о преподавателе';
}
// Направления: из CF-карты страницы, иначе — категория преподавателя (trainingCategory)
$dir_slugs = array();
if (! empty($map_dirs['by_teacher'][ $tid ])) {
$dir_slugs = $map_dirs['by_teacher'][ $tid ];
@ -81,6 +81,7 @@ $cat_filter = implode(' ', $dir_slugs);
<?php if ($avatar_url) : ?>
<img class="teachers-card__photo" loading="lazy" decoding="async"
src="<?php echo esc_url($avatar_url); ?>"
<?php if ($avatar_srcset) : ?>srcset="<?php echo esc_attr($avatar_srcset); ?>" sizes="(max-width: 640px) 92vw, 320px"<?php endif; ?>
alt="<?php echo esc_attr($alt_photo); ?>"
width="480" height="384">
<?php else : ?>

View File

@ -1,6 +1,6 @@
<?php
// Секция «Наши преподаватели» (страница /our-teachers/)
if (! defined('ABSPATH')) {
exit;

View File

@ -12,12 +12,11 @@ if (empty($flt_title)) {
$flt_title = 'Выберите направление';
}
// Направления из CF-карты страницы (label/slug/filter_teachers)
$map = dekart_teacher_directions_map();
$slugs = $map['slugs'];
if (empty($slugs)) {
// Дефолт без CF — направления школы
$slugs = array(
'nachalnaya-shkola' => 'Начальная школа',
'podgotovka-k-shkole' => 'Подготовка к школе',

View File

@ -23,7 +23,6 @@ $school_year = $current_year . '/' . $next_year;
// H1 с гео-ключом
$teachers_h1 = trim('Преподаватели школы «' . $branch_name . '» ' . $branch_city_prep);
// Фото — преподаватель «выводить первым», иначе последний по дате
$hero_args = array(
'post_type' => 'teacher',
'post_status' => 'publish',

View File

@ -18,7 +18,7 @@ if (empty($intro_title)) {
$intro_text = carbon_get_post_meta($post_id, 'teachers_intro_text');
if (empty($intro_text)) {
// Дефолт без хардкода города/цифр
$intro_count = (int) wp_count_posts('teacher')->publish;
$intro_where = 'школе «' . $intro_brand . '»' . ( $intro_city ? ' в ' . $intro_city : '' );
$intro_text = sprintf(

View File

@ -14,7 +14,7 @@ $org_name = dekart_branch_option('branch_name') ?: carbon_get_theme_option('sit
$org_phone = dekart_branch_option('branch_phone') ?: carbon_get_theme_option('site_phone') ?: '';
$org_logo = function_exists('dekart_resolve_logo') ? dekart_resolve_logo() : '';
// Адрес — PostalAddress из опций филиала
$addr = array( '@type' => 'PostalAddress' );
$street = get_option('branch_address') ?: carbon_get_theme_option('site_address') ?: '';
$city = dekart_branch_option('branch_city');
@ -96,7 +96,6 @@ foreach ($schema_teachers as $st) {
if ($img && wp_get_attachment_url($img)) {
$person['image'] = wp_get_attachment_url($img);
}
// aggregateRating НЕ выводим — на листинге нет объектов review
$teachers_schema[] = $person;

View File

@ -22,7 +22,7 @@ if (is_array($trust)) {
}
if (empty($trust_items)) {
// Дефолт без хардкода — считаем из данных
$teachers_count = (int) wp_count_posts('teacher')->publish;
$years = array();
$cur = (int) current_time('Y');