2026-06-2026 Отзывы полный редизайн

This commit is contained in:
Dekart Deploy Bot 2026-06-28 16:17:21 +00:00
parent 12171f216b
commit 465355a775
3 changed files with 48 additions and 11 deletions

View File

@ -1383,6 +1383,31 @@ function enqueue_template_specific_styles() {
}
add_action('wp_enqueue_scripts', 'enqueue_template_specific_styles');
/**
* Helper: determine if current page needs Swiper slider assets.
*
* @return bool True if the current page uses Swiper directly or via template-parts.
*/
function needs_swiper(): bool {
if ( is_singular( [ 'course', 'teacher' ] ) ) {
return true;
}
$swiper_templates = [
'page-after-school.php',
'page-foto.php',
'page-o-nas.php',
'page-school.php',
'page-contacts.php',
'page-teachers.php',
];
foreach ( $swiper_templates as $tmpl ) {
if ( is_page_template( $tmpl ) ) {
return true;
}
}
return false;
}
add_shortcode( 'get_form_bitrix', 'form_bitrix' );
function form_bitrix( $atts, $content = null ) {
return carbon_get_theme_option( 'site_bitrix_script' );

View File

@ -14,7 +14,7 @@
<link rel="dns-prefetch" href="//mod.gudok.tel">
<?php
// ─────────────────────────────────────────────────────────────────────
// PRELOAD
// PRELOAD 1
// ─────────────────────────────────────────────────────────────────────
?>
<link rel="preload" as="image"
@ -51,10 +51,12 @@ if ( is_front_page() ) {
<link rel="stylesheet" href="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/css/reset.css" media="all">
<link rel="stylesheet" href="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/css/main.css" media="all">
<?php if ( function_exists( 'needs_swiper' ) && needs_swiper() ) : ?>
<link rel="preload" as="style"
href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"
onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"></noscript>
<?php endif; ?>
<?php
// Google Fonts
@ -69,7 +71,9 @@ if ( is_front_page() ) {
?>
<?php if ( function_exists( 'needs_swiper' ) && needs_swiper() ) : ?>
<script src="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.js" defer></script>
<?php endif; ?>
<script src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/js/add.js" defer></script>
<?php wp_head(); ?>

View File

@ -18,15 +18,16 @@ add_filter( 'wpseo_opengraph_type', function ( $type ) {
return $type;
} );
add_filter( 'wpseo_frontend_presenter_classes', function ( $presenters ) {
if ( is_page_template( 'page-reviews.php' ) ) {
$presenters = array_filter( $presenters, function ( $p ) {
if ( is_page_template( 'page-reviews.php' ) ) {
$presenters = array_filter( $presenters, function ( $p ) {
return strpos( $p, 'Open_Graph' ) === false
&& strpos( $p, 'Article_' ) === false
&& strpos( $p, 'Label1' ) === false
&& strpos( $p, 'Data1' ) === false
&& strpos( $p, 'Twitter' ) === false;
} );
return strpos( $p, 'Open_Graph' ) === false
&& strpos( $p, 'Article_' ) === false
&& strpos( $p, 'Label1' ) === false
&& strpos( $p, 'Data1' ) === false
&& strpos( $p, 'Twitter' ) === false
&& strpos( $p, 'Slack' ) === false;
} );
}
return $presenters;
} );
@ -98,6 +99,7 @@ $branch_addr = get_option( 'branch_address' ) ?: carbon_get_theme_option( 'sit
$branch_coords = get_option( 'branch_coords' ) ?: carbon_get_theme_option( 'site_location' ) ?: '';
$branch_logo = get_option( 'branch_logo' ) ?: '';
$branch_region = get_option( 'branch_region' ) ?: 'Московская область';
$branch_price_range = get_option( 'branch_price_range', '' );
$branch_social = get_option( 'branch_social' ) ?: carbon_get_theme_option( 'social_media' ) ?: array();
$branch_messengers = get_option( 'branch_messengers', array() );
@ -1145,7 +1147,7 @@ if ( ! empty( $schema_description ) && is_string( $schema_description ) ) {
}
$organization = array(
'@type' => array( 'School', 'LocalBusiness' ),
'@type' => 'School',
'@id' => home_url( '/' ) . '#organization',
'name' => $branch_name,
'description' => $org_description,
@ -1154,6 +1156,10 @@ $organization = array(
'areaServed' => $area_served,
);
if ( $branch_price_range ) {
$organization['priceRange'] = $branch_price_range;
}
if ( ! empty( $hours_spec ) ) {
$organization['openingHoursSpecification'] = $hours_spec;
}
@ -1189,6 +1195,8 @@ if ( $jsonld_img_url ) {
}
if ( $school_image_url ) {
$organization['image'] = $school_image_url;
} elseif ( $jsonld_img_url ) {
$organization['image'] = $jsonld_img_url;
}
if ( ! empty( $jsonld_social ) ) {
$organization['sameAs'] = $jsonld_social;