diff --git a/wp-content/themes/dekart/functions.php b/wp-content/themes/dekart/functions.php index 08455ea..9cf99cb 100644 --- a/wp-content/themes/dekart/functions.php +++ b/wp-content/themes/dekart/functions.php @@ -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' ); diff --git a/wp-content/themes/dekart/header.php b/wp-content/themes/dekart/header.php index d185b46..c5e32e7 100644 --- a/wp-content/themes/dekart/header.php +++ b/wp-content/themes/dekart/header.php @@ -14,7 +14,7 @@ + + + + diff --git a/wp-content/themes/dekart/page-reviews.php b/wp-content/themes/dekart/page-reviews.php index b8ad7da..7a98984 100644 --- a/wp-content/themes/dekart/page-reviews.php +++ b/wp-content/themes/dekart/page-reviews.php @@ -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 ) { - - return strpos( $p, 'Open_Graph' ) === false - && strpos( $p, 'Article_' ) === false - && strpos( $p, 'Label1' ) === false - && strpos( $p, 'Data1' ) === false - && strpos( $p, 'Twitter' ) === false; - } ); + 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 + && 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;