2026-06-2026 Отзывы полный редизайн
This commit is contained in:
parent
12171f216b
commit
465355a775
@ -1383,6 +1383,31 @@ function enqueue_template_specific_styles() {
|
|||||||
}
|
}
|
||||||
add_action('wp_enqueue_scripts', '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' );
|
add_shortcode( 'get_form_bitrix', 'form_bitrix' );
|
||||||
function form_bitrix( $atts, $content = null ) {
|
function form_bitrix( $atts, $content = null ) {
|
||||||
return carbon_get_theme_option( 'site_bitrix_script' );
|
return carbon_get_theme_option( 'site_bitrix_script' );
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<link rel="dns-prefetch" href="//mod.gudok.tel">
|
<link rel="dns-prefetch" href="//mod.gudok.tel">
|
||||||
<?php
|
<?php
|
||||||
// ─────────────────────────────────────────────────────────────────────
|
// ─────────────────────────────────────────────────────────────────────
|
||||||
// PRELOAD
|
// PRELOAD 1
|
||||||
// ─────────────────────────────────────────────────────────────────────
|
// ─────────────────────────────────────────────────────────────────────
|
||||||
?>
|
?>
|
||||||
<link rel="preload" as="image"
|
<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/reset.css" media="all">
|
||||||
<link rel="stylesheet" href="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/css/main.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"
|
<link rel="preload" as="style"
|
||||||
href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"
|
href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"
|
||||||
onload="this.onload=null;this.rel='stylesheet'">
|
onload="this.onload=null;this.rel='stylesheet'">
|
||||||
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"></noscript>
|
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"></noscript>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Google Fonts
|
// 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>
|
<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>
|
<script src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/js/add.js" defer></script>
|
||||||
|
|
||||||
<?php wp_head(); ?>
|
<?php wp_head(); ?>
|
||||||
|
|||||||
@ -25,7 +25,8 @@ add_filter( 'wpseo_frontend_presenter_classes', function ( $presenters ) {
|
|||||||
&& strpos( $p, 'Article_' ) === false
|
&& strpos( $p, 'Article_' ) === false
|
||||||
&& strpos( $p, 'Label1' ) === false
|
&& strpos( $p, 'Label1' ) === false
|
||||||
&& strpos( $p, 'Data1' ) === false
|
&& strpos( $p, 'Data1' ) === false
|
||||||
&& strpos( $p, 'Twitter' ) === false;
|
&& strpos( $p, 'Twitter' ) === false
|
||||||
|
&& strpos( $p, 'Slack' ) === false;
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
return $presenters;
|
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_coords = get_option( 'branch_coords' ) ?: carbon_get_theme_option( 'site_location' ) ?: '';
|
||||||
$branch_logo = get_option( 'branch_logo' ) ?: '';
|
$branch_logo = get_option( 'branch_logo' ) ?: '';
|
||||||
$branch_region = get_option( 'branch_region' ) ?: 'Московская область';
|
$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_social = get_option( 'branch_social' ) ?: carbon_get_theme_option( 'social_media' ) ?: array();
|
||||||
$branch_messengers = get_option( 'branch_messengers', array() );
|
$branch_messengers = get_option( 'branch_messengers', array() );
|
||||||
|
|
||||||
@ -1145,7 +1147,7 @@ if ( ! empty( $schema_description ) && is_string( $schema_description ) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$organization = array(
|
$organization = array(
|
||||||
'@type' => array( 'School', 'LocalBusiness' ),
|
'@type' => 'School',
|
||||||
'@id' => home_url( '/' ) . '#organization',
|
'@id' => home_url( '/' ) . '#organization',
|
||||||
'name' => $branch_name,
|
'name' => $branch_name,
|
||||||
'description' => $org_description,
|
'description' => $org_description,
|
||||||
@ -1154,6 +1156,10 @@ $organization = array(
|
|||||||
'areaServed' => $area_served,
|
'areaServed' => $area_served,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( $branch_price_range ) {
|
||||||
|
$organization['priceRange'] = $branch_price_range;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! empty( $hours_spec ) ) {
|
if ( ! empty( $hours_spec ) ) {
|
||||||
$organization['openingHoursSpecification'] = $hours_spec;
|
$organization['openingHoursSpecification'] = $hours_spec;
|
||||||
}
|
}
|
||||||
@ -1189,6 +1195,8 @@ if ( $jsonld_img_url ) {
|
|||||||
}
|
}
|
||||||
if ( $school_image_url ) {
|
if ( $school_image_url ) {
|
||||||
$organization['image'] = $school_image_url;
|
$organization['image'] = $school_image_url;
|
||||||
|
} elseif ( $jsonld_img_url ) {
|
||||||
|
$organization['image'] = $jsonld_img_url;
|
||||||
}
|
}
|
||||||
if ( ! empty( $jsonld_social ) ) {
|
if ( ! empty( $jsonld_social ) ) {
|
||||||
$organization['sameAs'] = $jsonld_social;
|
$organization['sameAs'] = $jsonld_social;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user