From 12171f216bb9d1bab3597aa56d54f5cd87a40684 Mon Sep 17 00:00:00 2001 From: Dekart Deploy Bot Date: Sun, 28 Jun 2026 12:32:32 +0000 Subject: [PATCH] Admin test: git push from WordPress --- wp-content/themes/dekart/page-reviews.php | 179 ++++++---------------- 1 file changed, 46 insertions(+), 133 deletions(-) diff --git a/wp-content/themes/dekart/page-reviews.php b/wp-content/themes/dekart/page-reviews.php index 0118dec..b8ad7da 100644 --- a/wp-content/themes/dekart/page-reviews.php +++ b/wp-content/themes/dekart/page-reviews.php @@ -10,7 +10,6 @@ * @package Dekart */ -// ─── Yoast SEO: отключаем article-режим ─── add_filter( 'wpseo_json_ld_output', '__return_false' ); add_filter( 'wpseo_opengraph_type', function ( $type ) { if ( is_page_template( 'page-reviews.php' ) ) { @@ -21,7 +20,7 @@ add_filter( 'wpseo_opengraph_type', function ( $type ) { add_filter( 'wpseo_frontend_presenter_classes', function ( $presenters ) { if ( is_page_template( 'page-reviews.php' ) ) { $presenters = array_filter( $presenters, function ( $p ) { - // Open_Graph + Twitter — отключаем весь блок OG/Twitter-тегов Yoast, т.к. выводим свои + return strpos( $p, 'Open_Graph' ) === false && strpos( $p, 'Article_' ) === false && strpos( $p, 'Label1' ) === false @@ -34,7 +33,6 @@ add_filter( 'wpseo_frontend_presenter_classes', function ( $presenters ) { add_filter( 'wpseo_twitter_label1', '__return_empty_string' ); add_filter( 'wpseo_twitter_data1', '__return_empty_string' ); -// Open Graph (полный набор) из featured image add_action( 'wp_head', function () { if ( ! is_page_template( 'page-reviews.php' ) ) { return; @@ -42,7 +40,7 @@ add_action( 'wp_head', function () { $post_id = get_queried_object_id(); $thumb_id = get_post_thumbnail_id( $post_id ); - // Preconnect + preload для Phosphor Icons (CDN, render-blocking → отложенная загрузка) + echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; @@ -63,7 +61,7 @@ add_action( 'wp_head', function () { if ( $alt ) { echo '' . "\n"; } - // Preload hero-изображения для LCP + $img_large = wp_get_attachment_image_src( $thumb_id, 'large' ); if ( $img_large ) { echo '' . "\n"; @@ -77,7 +75,7 @@ add_action( 'wp_head', function () { echo '' . "\n"; echo '' . "\n"; - // Twitter Card (из того же featured image) + echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; @@ -86,16 +84,11 @@ add_action( 'wp_head', function () { } }, 1 ); -// Критический CSS для LCP вынесен в assets/css/reviews-page.css. -// Inline-блок удалён: все hero-стили уже есть в CSS-файле. -// ════════════════════════════════════════════════════════════ - get_header(); $post_id = get_the_ID(); $theme_uri = get_template_directory_uri(); -// ─── ДАННЫЕ ФИЛИАЛА (Settings API → CF theme option) ─── $branch_city = get_option( 'branch_city' ) ?: carbon_get_theme_option( 'site_city' ) ?: 'Щёлково'; $branch_city_prep = get_option( 'branch_city_prep' ) ?: 'в Щёлково'; $branch_phone = get_option( 'branch_phone' ) ?: carbon_get_theme_option( 'site_phone' ) ?: ''; @@ -108,9 +101,6 @@ $branch_region = get_option( 'branch_region' ) ?: 'Московская обла $branch_social = get_option( 'branch_social' ) ?: carbon_get_theme_option( 'social_media' ) ?: array(); $branch_messengers = get_option( 'branch_messengers', array() ); -// ─── КОНТЕНТ СТРАНИЦЫ (Carbon Fields post_meta) ─── - -// Метрики доверия (только из Carbon Fields — никаких хардкод-значений) $metric_1_num = carbon_get_post_meta( $post_id, 'reviews_hero_metric_1_number' ); $metric_1_lbl = carbon_get_post_meta( $post_id, 'reviews_hero_metric_1_label' ); $metric_2_num = carbon_get_post_meta( $post_id, 'reviews_hero_metric_2_number' ); @@ -120,28 +110,21 @@ $metric_3_lbl = carbon_get_post_meta( $post_id, 'reviews_hero_metric_3_label' ) $metric_4_num = carbon_get_post_meta( $post_id, 'reviews_hero_metric_4_number' ); $metric_4_lbl = carbon_get_post_meta( $post_id, 'reviews_hero_metric_4_label' ); -// Результаты $results_title = carbon_get_post_meta( $post_id, 'reviews_results_title' ) ?: 'Декарт в цифрах'; $results_items = carbon_get_post_meta( $post_id, 'reviews_results' ); -// FAQ $faq_items = carbon_get_post_meta( $post_id, 'reviews_faq' ); -// Скрипт для кнопок (Bitrix24) из настроек филиала $branch_button_script = get_option( 'branch_button_script', '' ); -// Виджет MyReviews из настроек филиала $myreviews_widget = get_option( 'branch_myreviews_widget', '' ); -// Перелинковка $cross_title = carbon_get_post_meta( $post_id, 'reviews_cross_title' ) ?: 'Наши программы'; $cross_links = carbon_get_post_meta( $post_id, 'reviews_cross_links' ); -// Видеоотзывы $video_title = carbon_get_post_meta( $post_id, 'reviews_video_title' ) ?: 'Видеоотзывы родителей'; $video_items = carbon_get_post_meta( $post_id, 'reviews_video' ); -// ─── ЛОГОТИП ДЛЯ JSON-LD ─── if ( $branch_logo && is_array( $branch_logo ) ) { $jsonld_img_url = $branch_logo['url'] ?? ''; } elseif ( $branch_logo ) { @@ -154,9 +137,6 @@ if ( ! $jsonld_img_url ) { $jsonld_img_url = $logo_id ? wp_get_attachment_url( $logo_id ) : ''; } -// ─── ИЗОБРАЖЕНИЕ ШКОЛЫ ДЛЯ JSON-LD (image) ─── -// Используем featured image главной страницы (page_on_front). -// Schema.org рекомендует минимум 696px ширины. $school_image_url = ''; $front_page_id = (int) get_option( 'page_on_front' ); if ( $front_page_id && has_post_thumbnail( $front_page_id ) ) { @@ -166,25 +146,21 @@ if ( $front_page_id && has_post_thumbnail( $front_page_id ) ) { } } -// ─── СОЦСЕТИ ДЛЯ JSON-LD (sameAs) ─── $jsonld_social = array(); -// 1. branch_social (Settings API) — формат: [['name' => 'VK', 'url' => 'https://...']] -// или CF social_media fallback: [['social_media_name' => '', 'social_media_link' => 'https://...']] if ( is_array( $branch_social ) ) { foreach ( $branch_social as $s ) { - // Settings API: ['name', 'url'] + if ( ! empty( $s['url'] ) ) { $jsonld_social[] = $s['url']; } - // CF theme option social_media: ['social_media_name', 'social_media_link'] + if ( ! empty( $s['social_media_link'] ) ) { $jsonld_social[] = $s['social_media_link']; } } } -// 2. branch_messengers — мессенджеры (WhatsApp, Telegram) тоже в sameAs if ( is_array( $branch_messengers ) ) { foreach ( $branch_messengers as $m ) { if ( ! empty( $m['url'] ) ) { @@ -193,14 +169,11 @@ if ( is_array( $branch_messengers ) ) { } } -// Удаляем дубликаты (если VK есть и в соцсетях, и в мессенджерах) $jsonld_social = array_values( array_unique( $jsonld_social ) ); ?>
- + - +
- +

Отзывы о частной школе «Декарт»

Родители доверяют нам самое главное — вот что они говорят о нас

$metric_1_num, 'lbl' => $metric_1_lbl ); @@ -253,7 +224,7 @@ $jsonld_social = array_values( array_unique( $jsonld_social ) );
- +
★★★★★ @@ -264,7 +235,7 @@ $jsonld_social = array_values( array_unique( $jsonld_social ) ); Записаться на экскурсию → - +

Или позвоните:

@@ -289,9 +260,7 @@ $jsonld_social = array_values( array_unique( $jsonld_social ) );
- + - + $ext_other_name, 'url' => $ext_other_url ); } ?> - +
@@ -371,12 +336,10 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' );
- +
- +

Отзывы родителей о частной школе

Все отзывы проходят проверку — мы связываемся с родителями и убеждаемся в достоверности каждого отзыва. Здесь собраны настоящие истории семей, чьи дети учатся в частной школе «Декарт» в Щёлково. Читайте, знакомьтесь и присоединяйтесь!

@@ -385,7 +348,7 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' ); if ( empty( $reviews_cards ) || ! is_array( $reviews_cards ) ) { $reviews_cards = array(); } - // Обратный порядок — новые сверху + $reviews_cards = array_reverse( $reviews_cards ); if ( ! empty( $reviews_cards ) ) : @@ -470,9 +433,7 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' );
- + - +
@@ -519,7 +478,7 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' );
- +

Хотите так же? Запишитесь на день открытых дверей

@@ -527,9 +486,7 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' );
- + - +
@@ -578,9 +533,9 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' ); if ( ! $video_url ) { continue; } - // Пытаемся получить embed: YouTube → VK Video → любой oEmbed-провайдер + $embed_html = ''; - // 1. YouTube + if ( preg_match( '/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]+)/', $video_url, $m ) ) { $embed_url = 'https://www.youtube.com/embed/' . $m[1]; $embed_html = ''; } - // 2. VK Video / любой другой oEmbed-провайдер (Rutube, VK Video, etc.) + if ( ! $embed_html ) { $maybe_embed = wp_oembed_get( $video_url, array( 'width' => 560, 'height' => 315 ) ); if ( $maybe_embed ) { @@ -619,11 +574,9 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' );
- + - +
@@ -644,7 +597,7 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' );
- +

Остались вопросы? Позвоните:

@@ -652,9 +605,7 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' );
- +
@@ -705,9 +656,7 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' );
- +
@@ -762,7 +711,7 @@ $intro_price_txt = carbon_get_post_meta( $post_id, 'reviews_intro_price_text' );
- +
- +