HEX
Server: Apache/2.4.62 (Debian)
System: Linux plxsite 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024 x86_64
User: root (0)
PHP: 8.1.30
Disabled: NONE
Upload Files
File: //proc/7575/cwd/wp-content/themes/polygant_2023/single-post.php
<?php

get_header('new');

$cur_id = get_the_ID();
$cat = get_the_category($cur_id);

// ID категории
$categ = $cat->term_id ; 

$categories = get_the_category();
$catiti = $categories[0]->term_id ;

?>

<section class="info-page">
  

    <div class="container">
        <div class="one-single-post-header">


                            <div class="bread">
                   <p id="breadcrumbs"><span>
                       
                          <span>    <?php   $my_home_url = "/"; ?>
<a href="<?php echo $my_home_url; ?>" ><?php the_field('главная_название' ,  apply_filters( 'wpml_object_id', 233, 'page' ) );?></a></span>
                       
                     <?php   $categories = get_the_category();

if ( ! empty( $categories ) ) {
    
    ?>
                         —    <span>    
<a href="<?php echo esc_url( get_category_link( $categories[0]->term_id ) );?>"><?php the_field('основное_название_категории' , $categories[0] );?> </a>
                       <?php
    
    
    ?>
                      </span>
                             <?php
}
                       ?>
                     
                       
                       — <span class="breadcrumb_last" aria-current="page">   <?php the_title();?></span>
                       
                       </span></p>
                </div>


                <h1 class="info-page__title">
                    <?php if (get_field("sp_main_title")) { ?>
                    <?php the_field('sp_main_title'); ?>
                    <?php } else { ?>
                    <?php the_title(); ?>
                    <?php } ?>
                </h1>


        <div class="one-single-post-header-sf">
                    <div class="one-single-post-header-sf-left">
             

                        
                        <?php if( get_field("краткое_описание") ): ?>
<div class="dop-descr-single-service info-page__content content">
                            <?php the_field('краткое_описание');?>
                        </div>
<?php else :?>
    
<?php endif; ?>
                        
                        
                            
                        
                        
                               <?php
if( have_rows('преимущества_или_услуги' ) ):
                        ?>
                        <div class="dop-priem-single-service">
                        <?php
    while ( have_rows('преимущества_или_услуги' ) ) : the_row();
   ?>
<div class="dop-priem-single-service-item"><img src="/wp-content/uploads/2023/06/check.svg"> <?php the_sub_field('пункт_преимущества'); ?></div>
    <?php
    endwhile;
                        ?>
                        </div>
                        <?php
else :
endif;
?> 
                        <?php if( get_field("краткое_описание") ): ?>
                        
                        
                        
<div class="archive-line-qw0whats rubread11">
                    <a href="" data-popup="form" class="hero__btn">   <?php the_field('request_a_quote' , apply_filters( 'wpml_object_id', 233, 'page' ) );?>    </a>
                    <span>  <?php the_field('or_contact_us_on' ,  apply_filters( 'wpml_object_id', 233, 'page' ) );?>
                    <a href="https://wa.me/message/SUBN2P3AVQCOF1" >  <img src="/wp-content/uploads/2023/06/wh.svg" alt="whatsapp">  WhatsApp   </a></span>
                    
                </div>
                        
                        
                        
                        
                <div class="hero__footer enbread11">
                    <?php if (get_field("sp_btn_first_title")) { ?>
                    <?php $btn_title1 = get_field("sp_btn_first_title"); ?>
                    <?php } else { ?>
                    <?php $btn_title1 = "Получить консультацию"; ?>
                    <?php } ?>
                    <a href="#" data-popup="form" class="hero__btn"><?php echo $btn_title1; ?></a>

                    <?php if (get_field("sp_btn_first_title_extra")) { ?>
                    <a href="<?php the_field('sp_btn_first_title_extra_link');?>" target="_blank" class="hero__btn extra"><?php the_field('sp_btn_first_title_extra');?></a>
                    <?php } ?>
                    
                    <!--<div class="hero__footer-text">
                       <?php // the_field('or_contact_us_on' ,  apply_filters( 'wpml_object_id', 233, 'page' ) );?>
                        <a href="  <?php // the_field('ссылка_на_телеграм' ,  apply_filters( 'wpml_object_id', 233, 'page' ) );?>" class="hero__link">
                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none"
                                xmlns="http://www.w3.org/2000/svg">
                                <path
                                    d="M20.665 3.717L2.935 10.554C1.725 11.04 1.732 11.715 2.713 12.016L7.265 13.436L17.797 6.791C18.295 6.488 18.75 6.651 18.376 6.983L9.843 14.684H9.841L9.843 14.685L9.529 19.377C9.989 19.377 10.192 19.166 10.45 18.917L12.661 16.767L17.26 20.164C18.108 20.631 18.717 20.391 18.928 19.379L21.947 5.151C22.256 3.912 21.474 3.351 20.665 3.717Z"
                                    fill="white" />
                            </svg>
                             <?php // the_field('telegram' ,  apply_filters( 'wpml_object_id', 233, 'page' ) );?>
                        </a>
                    </div>-->
                </div>
<?php else :?>
    
<?php endif; ?> 
            </div>
        <?php if( get_field("краткое_описание") ): ?>
                <?php 
                if( has_post_thumbnail() ) {
?>  <div class="one-single-post-header-sf-right">
                
                
                
                <div class="one-single-post-header-sf-right-image" style="background: url(<?php echo get_the_post_thumbnail_url(); ?>); background-position: center; background-repeat: no-repeat; background-size: cover;"></div></div>
                <?php
} 
                ?>
                                    <?php
else :
endif;
?> 
                
            
            </div>
        </div>


        <?php
        $sec1 = get_field('sp_sec_1');
        if( $sec1 ): ?>
        <div class="sp_sec_1" id="sp_sec_1">
            <h2 class="sp-h2-title"><?php echo $sec1['title']; ?></h2>
            <div class="content-wrap">
                <div class="first" style="background-image: url('<?php echo $sec1['img']; ?>');"></div>
                <div class="second">
                    <?php
                    while ( have_rows( 'sp_sec_1' ) ) : the_row();
                      while ( have_rows( 'list' ) ) : the_row();
                          ?>
                          <div class="item">
                            <p class="title"><?php the_sub_field( 'list_title' ); ?></p>
                            <p class="subtitle"><?php the_sub_field( 'list_descr' ); ?></p>
                          </div>
                          <?php
                      endwhile;
                    endwhile;
                    ?>
                </div>
            </div>
            <div class="list-extra">
                <?php
                    while ( have_rows( 'sp_sec_1' ) ) : the_row();
                      while ( have_rows( 'list_extra' ) ) : the_row();
                          ?>
                          <div class="item">
                            <p class="title"><?php the_sub_field( 'list_extra_title' ); ?></p>
                            <p class="subtitle"><?php the_sub_field( 'list_extra_descr' ); ?></p>
                          </div>
                          <?php
                      endwhile;
                    endwhile;
                    ?>                
            </div>
        </div>
        <?php endif; ?>
        
        
        <?php
        $vk_video_extra = get_field( "vk_content_shortcode" );
        if ( $vk_video_extra ) {
            ?>
            <div class="vk-video-extra-sec">
                <?php echo do_shortcode( get_field( "vk_content_shortcode" ) ); ?>
            </div>
            <?php
        }
        ?>
        
        
        <?php
            $chat_bot_show = get_field( "chat_bot_show", $queried_object );
            if ( $chat_bot_show ) {
                ?>          
            <h2 class="sp-h2-title polygant-chat"><?php the_field('chat_bot_show_title', $queried_object); ?></h2>
    <div class="chat-container" id="polygant-chat">
  <div class="chat-header">Polygant ChatBot</div>
  <div class="chat-messages" id="messages"></div>
  <form class="chat-input" id="chatForm">
    <input type="text" id="userInput" placeholder="Write a message..." autocomplete="off" />
    <button type="submit">Send</button>
  </form>
</div>

<script>
    
    function getOrCreateVisitorId() {
      let visitorId = localStorage.getItem("visitor_id");
      if (!visitorId) {
        visitorId = crypto.randomUUID();  // или Math.random().toString(36).substring(2)
        localStorage.setItem("visitor_id", visitorId);
      }
      return visitorId;
    }
  //const API_BASE = "https://mgnmrestapi-production.up.railway.app";
  const API_BASE = "<?php the_field('api_url', $queried_object); ?>";
  const messagesContainer = document.getElementById("messages");
  const chatForm = document.getElementById("chatForm");
  const userInput = document.getElementById("userInput");
  const visitorId = getOrCreateVisitorId();

  const visitor = {
    name: "Test",
    email: "[email protected]",
	language: "en",
    id: visitorId
  };

  // Добавление сообщения
  function addMessage(text, sender = "bot", isTyping = false) {
    const message = document.createElement("div");
    message.className = `message ${sender}`;

    const avatar = document.createElement("div");
    avatar.className = `avatar ${sender}`;

    const bubble = document.createElement("div");
    bubble.className = "text";

    if (isTyping) {
      bubble.innerHTML = '<span class="typing">Bot is typing a reply...</span>';
    } else {
      bubble.textContent = text;
    }

    message.appendChild(avatar);
    message.appendChild(bubble);
    messagesContainer.appendChild(message);
    messagesContainer.scrollTop = messagesContainer.scrollHeight;

    return message;
  }

  // Отправка сообщений
  chatForm.addEventListener("submit", async (e) => {
    e.preventDefault();
    const question = userInput.value.trim();
    if (!question) return;

    addMessage(question, "user");
    userInput.value = "";

    const typingMsg = addMessage("", "bot", true);

    try {
      const response = await fetch(`${API_BASE}`, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
          handler: "message",
          visitor,
          message: { text: question }
        })
      });

      const data = await response.json();
      messagesContainer.removeChild(typingMsg);

      (data.replies || []).forEach(reply => addMessage(reply, "bot"));
    } catch (err) {
      messagesContainer.removeChild(typingMsg);
      addMessage("An error occurred while receiving a response.", "bot");
    }
  });

  // Приветствие через handler: "trigger"
  window.addEventListener("DOMContentLoaded", async () => {
    const typingMsg = addMessage("", "bot", true);

    try {
      const response = await fetch(`${API_BASE}`, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
          handler: "trigger",
          visitor
        })
      });

      const data = await response.json();
      messagesContainer.removeChild(typingMsg);

      (data.replies || []).forEach(reply => addMessage(reply, "bot"));
    } catch (err) {
      messagesContainer.removeChild(typingMsg);
      addMessage("Бот временно недоступен.", "bot");
    }
  });
</script>
<?php
            }
            ?>
        


        <?php
        $sec2 = get_field('sp_sec_2');
        if( $sec2 ): ?>
        <div class="sp_sec_2" id="sp_sec_2">
            <h2 class="sp-h2-title"><?php echo $sec2['title']; ?></h2>
            <div class="content-wrap">
                <div class="first"><?php echo $sec2['description']; ?></div>
                <?php if ( $sec2['pdf_btn_title'] ) { ?>
                <div class="second">
                    <p><?php echo $sec2['pdf_descr']; ?></p>
                    <div class="wrap-img-btn"><a class="img-btn" target="_blank" href="<?php echo $sec2['pdf_btn_link']; ?>"><img src="/wp-content/themes/polygant_2023/load-img/pdf-logo-opt.png"></a></div>
                    <a class="hero__btn" target="_blank" href="<?php echo $sec2['pdf_btn_link']; ?>"><?php echo $sec2['pdf_btn_title']; ?></a>
                </div>
                <?php } ?>
            </div>
        </div>
        <?php endif; ?>





<?php
$featured_cases = get_field('page-cases');
if( $featured_cases ): ?> 
                    
                                <div class="info-page__case reviews">

                                    <div class="reviews__head">
                                        <h2 class="info-page__case-title sp-h2-title"><?php the_field('sp_projects_title');?></h2>
                                        <div class="slider-controls reviews__controls">
                                            <div class="slider-controls__arrow slider-controls__arrow_prev info-page__arrow_prev">
                                                <svg width="8" height="13" viewBox="0 0 8 13" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                    <path fill-rule="evenodd" clip-rule="evenodd" d="M0.701814 10.821C0.357147 11.1657 0.357146 11.7245 0.701814 12.0692C1.04648 12.4138 1.6053 12.4138 1.94997 12.0692L7.0567 6.96242C7.06091 6.95836 7.0651 6.95426 7.06925 6.95011C7.30422 6.71514 7.379 6.38066 7.29361 6.08234C7.25375 5.94299 7.17895 5.81152 7.0692 5.70177C7.06612 5.69869 7.06303 5.69564 7.05991 5.69262L1.99144 0.624142C1.64677 0.279475 1.08796 0.279475 0.743289 0.624143C0.398621 0.96881 0.398622 1.52763 0.743289 1.8723L5.1969 6.32591L0.701814 10.821Z" fill="#6352CD"/>
                                                </svg>                                
                                            </div>
                                            <div class="slider-controls__pagination info-page__pagination cases-scr"></div>
                                            <div class="slider-controls__arrow slider-controls__arrow_next info-page__arrow_next">
                                                <svg width="8" height="13" viewBox="0 0 8 13" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                    <path fill-rule="evenodd" clip-rule="evenodd" d="M0.701814 10.821C0.357147 11.1657 0.357146 11.7245 0.701814 12.0692C1.04648 12.4138 1.6053 12.4138 1.94997 12.0692L7.0567 6.96242C7.06091 6.95836 7.0651 6.95426 7.06925 6.95011C7.30422 6.71514 7.379 6.38066 7.29361 6.08234C7.25375 5.94299 7.17895 5.81152 7.0692 5.70177C7.06612 5.69869 7.06303 5.69564 7.05991 5.69262L1.99144 0.624142C1.64677 0.279475 1.08796 0.279475 0.743289 0.624143C0.398621 0.96881 0.398622 1.52763 0.743289 1.8723L5.1969 6.32591L0.701814 10.821Z" fill="#6352CD"/>
                                                </svg>                                
                                            </div>
                                        </div>
                                    </div>

                                    
                                    <div class="swiper info-page__slider cases-scr">
                                    <div class="swiper-wrapper">
                                        <?php foreach( $featured_cases as $case ): 
                                            $post = $case;
                                            setup_postdata($case); ?>
                                    <div class="cases-item swiper-slide reviews-item">
                                        <div class="cases-item__img">
                                            <?php echo get_the_post_thumbnail(); ?>
                                        </div>
                                        <div class="cases-item__main">
                                            <h3 class="cases-item__title">
                                                <?php the_title(); ?>
                                            </h3>
                                            <div class="cases-item__label">
                                                <?php the_field('case-label'); ?>
                                            </div>
                                            <div class="cases-item__text">
                                                <p>
                                                        <?php the_field('case-descr');?> 
                                                </p>
                                              
                                            </div>
                                            <a href="<?php the_permalink(); ?>" class="cases-item__btn"> <?php the_field('read_more' ,  apply_filters( 'wpml_object_id', 233, 'page' ) );?>
</a>
                                        </div>
                                    </div>
                                    <?php endforeach; ?>

                                </div>
                                </div>



                                </div>
                            <?php 
wp_reset_postdata(); ?>
<?php endif; ?>




        <?php
        $sec3 = get_field('sp_sec_3');
        if( $sec3 ): ?>
        <div class="sp_sec_3" id="sp_sec_3">
            <h2 class="sp-h2-title"><?php echo $sec3['заголовок']; ?></h2>
            <div class="content-wrap">
                <div class="first">
                    <?php
                    while ( have_rows( 'sp_sec_3' ) ) : the_row();
                      while ( have_rows( 'list' ) ) : the_row();
                          ?>
                          <div class="item">
                            <p class="title"><?php the_sub_field( 'title' ); ?></p>
                            <p class="subtitle"><?php the_sub_field( 'descr' ); ?></p>
                          </div>
                          <?php
                      endwhile;
                    endwhile;
                    ?>
                </div>
                <div class="second" style="background-image: url('<?php echo $sec3['img']; ?>');">
                </div>
            </div>
        </div>
        <?php endif; ?>


        <?php
$featured_posts = get_field('page-reveiws');
if( $featured_posts ): ?>
   <div class="reviews reviews1">
                                <div class="reviews__head">
                                    <h2 class="reviews__title sp-h2-title"> 
                                           <?php the_field('sp_revi_title');?>
                                    </h2>
                                    <div class="slider-controls reviews__controls">
                                        <div class="slider-controls__arrow slider-controls__arrow_prev info-page__arrow_prev">
                                            <svg width="8" height="13" viewBox="0 0 8 13" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                <path fill-rule="evenodd" clip-rule="evenodd" d="M0.701814 10.821C0.357147 11.1657 0.357146 11.7245 0.701814 12.0692C1.04648 12.4138 1.6053 12.4138 1.94997 12.0692L7.0567 6.96242C7.06091 6.95836 7.0651 6.95426 7.06925 6.95011C7.30422 6.71514 7.379 6.38066 7.29361 6.08234C7.25375 5.94299 7.17895 5.81152 7.0692 5.70177C7.06612 5.69869 7.06303 5.69564 7.05991 5.69262L1.99144 0.624142C1.64677 0.279475 1.08796 0.279475 0.743289 0.624143C0.398621 0.96881 0.398622 1.52763 0.743289 1.8723L5.1969 6.32591L0.701814 10.821Z" fill="#6352CD"/>
                                            </svg>                                
                                        </div>
                                        <div class="slider-controls__pagination info-page__pagination reviews-scr"></div>
                                        <div class="slider-controls__arrow slider-controls__arrow_next info-page__arrow_next">
                                            <svg width="8" height="13" viewBox="0 0 8 13" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                <path fill-rule="evenodd" clip-rule="evenodd" d="M0.701814 10.821C0.357147 11.1657 0.357146 11.7245 0.701814 12.0692C1.04648 12.4138 1.6053 12.4138 1.94997 12.0692L7.0567 6.96242C7.06091 6.95836 7.0651 6.95426 7.06925 6.95011C7.30422 6.71514 7.379 6.38066 7.29361 6.08234C7.25375 5.94299 7.17895 5.81152 7.0692 5.70177C7.06612 5.69869 7.06303 5.69564 7.05991 5.69262L1.99144 0.624142C1.64677 0.279475 1.08796 0.279475 0.743289 0.624143C0.398621 0.96881 0.398622 1.52763 0.743289 1.8723L5.1969 6.32591L0.701814 10.821Z" fill="#6352CD"/>
                                            </svg>                                
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="swiper info-page__slider reviews-scr">
                                    <div class="swiper-wrapper">
                                            <?php foreach( $featured_posts as $post ): 

                                                // Setup this post for WP functions (variable must be named $post).
                                                setup_postdata($post); ?>
                                               



                                                  <div class="swiper-slide reviews-item">
                                                <div class="reviews-item__text">
                                                    <p>
                                                                                    <?php the_content(); ?>

                                                    </p>
                                                </div>
                                                <div class="reviews-author reviews-item__author">
                                                    <div class="reviews-author__img">
                                                                                            <?php the_post_thumbnail('full'); ?>

                                                    </div>
                                                    <div class="reviews-author__info">
                                                        <div class="reviews-author__name">
                                                          <?php the_title();?>
                                                        </div>
                                                        <div class="reviews-author__desc">
                                                                 <?php echo get_field('author-suptitle'); ?>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="reviews-item__icon">
                                                                                   <img src="<?php echo get_template_directory_uri(); ?>/inc/img/new-img//quote.svg" alt="qoute">

                                                </div>
                                            </div>


    <?php endforeach; ?>
      </div>
                                </div>
                            </div>
    <?php 
    // Reset the global post object so that the rest of the page works correctly.
    wp_reset_postdata(); ?>
<?php endif; ?>




<?php get_template_part('template-parts/contact-us-section'); ?>





        <div class="info-page__wrapper">
        

            <div class="info-page__main">


    <style>

.lang-en .button-show-pages-menuru {
display: none;
    }

.lang-ru .button-show-pages-menuen {
display: none;

    }
        .bread-two {
            display: none
        }
        .single-blog .bread-two {
            display: block;
        }
        .single-blog .bread-one {
            display: none;
        }
        .rubread , .enbread {
            display: none;
        }
        .lang-en .enbread {
            display: flex;
        }
        .lang-ru  .rubread{
                display: flex;
        }
        .lang-en .table-works__col  .enbread {
            display: inline;     color: #29292D;
        }
        .lang-ru  .table-works__col  .rubread{
                display: inline;     color: #29292D;
        }
        
</style>    
                
                     
                
                <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

               
            

                <?php if ( has_excerpt() ) : ?>
                    <div class="info-page__excerpt">
                        <?php the_excerpt(); ?>
                    </div>
                <?php endif; ?>

                <div class="info-page__content content info-page__content-nomt" >

                    <?php the_content(); ?>

                    <?php $rateUsd = get_field('hourly_rate_usd'); ?>
                    <?php $rateEur = get_field('hourly_rate_eur'); ?>
                    <?php if ($rateUsd) : ?>
                        <div class="hourlyRate"> <span class="enbread">Hourly Rate:</span> <span class="rubread">Час работы: </span> <span><?php echo $rateUsd; ?> USD
                            <?php if ($rateEur) : ?>
                                (<?php echo $rateEur; ?> EUR)
                            <?php endif; ?></span>
                        </div>
                    <?php endif; ?>

                    <?php $developers = get_field('developers'); ?>

                    <?php if ($developers) : ?>
                        <div class="developers">
                            <?php foreach ($developers as $key => $post_id) : ?>
                                <?php $devImage = get_the_post_thumbnail_url($post_id, 'dev'); ?>
                                <?php $skill = get_field('skill', $post_id); ?>

                                <div class="developers-item">
                                    <div class="developers-item__img">
                                        <img src="<?php if ($devImage) { echo $devImage; } else { echo get_template_directory_uri() . '/img/devImg.jpg'; } ?>">
                                    </div>
                                    <div class="developers-item__info">
                                        <div class="developers-item__title">
                                            <?php echo get_the_title($post_id); ?>
                                                <?php if ($skill) : ?>,
                                                    <span>
                                                        <?php echo $skill; ?>
                                                    </span> 
                                                <?php endif; ?></div>
                                        <div class="developers-item__skills">
                                            <?php $skills = wp_get_post_terms($post_id, 'skill'); ?>
                                            <ul>
                                                <?php foreach ($skills as $key => $skill) : ?>
                                                    <li>
                                                        <?php echo $skill->name; ?>
                                                    </li>
                                                <?php endforeach; ?>
                                            </ul>
                                        </div>
                                        <div class="developers-item__content">
                                            <?php echo get_post_field('post_content', $post_id); ?>
                                        </div>
                                        <a href="#" data-popup="form" class="developers-item__btn">Hire Developer</a>
                                    </div>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    <?php endif; ?>

                    <?php $text2 = get_field('text2'); ?>
                    <?php if ($text2) : ?>
                        <?php echo $text2; ?>
                    <?php endif; ?>

                    <?php $table_works = get_field('table_works'); ?>
                    <?php if ($table_works['table']) : ?>
                    <h4>
                        <?php echo $table_works['title']; ?>
                    </h4>
                        <div class="table-works">
                            <?php foreach ($table_works['table'] as $key => $item) : ?>
                                <?php $rate_usd = $item['rate_usd']; ?>
                                <?php $rate_eur = $item['rate_eur']; ?>
                                <div class="table-works__row">
                                    <div class="table-works__col"><?php echo $item['title']; ?></div>
                                    <div class="table-works__col"> <span class="enbread">Hourly Rate:</span> <span class="rubread">Час работы: </span> <span><?php echo $rate_usd; ?> USD
                                            <?php if ($rate_usd) { ?>(<?php echo $rate_eur; ?> EUR)<?php } ?></span></div>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    <?php endif; ?>




 <!--<div class="blog-item__meta" style="opacity: 0;">
                        
                        <div class="blog-item__el">
                            <div class="blog-item__el-icon">
                                <svg width="19" height="12" viewBox="0 0 19 12" fill="none" xmlns="http://www.w3.org/2000/svg">
                                    <g clip-path="url(#clip0_96_195)">
                                    <path d="M9.5 0C5.18182 0 1.49409 2.488 0 6C1.49409 9.512 5.18182 12 9.5 12C13.8182 12 17.5059 9.512 19 6C17.5059 2.488 13.8182 0 9.5 0ZM9.5 10C7.11636 10 5.18182 8.208 5.18182 6C5.18182 3.792 7.11636 2 9.5 2C11.8836 2 13.8182 3.792 13.8182 6C13.8182 8.208 11.8836 10 9.5 10ZM9.5 3.6C8.06636 3.6 6.90909 4.672 6.90909 6C6.90909 7.328 8.06636 8.4 9.5 8.4C10.9336 8.4 12.0909 7.328 12.0909 6C12.0909 4.672 10.9336 3.6 9.5 3.6Z" fill="#9CA1AB"/>
                                    </g>
                                    <defs>
                                    <clipPath id="clip0_96_195">
                                    <rect width="19" height="12" fill="white"/>
                                    </clipPath>
                                    </defs>
                                </svg>
                            </div>
                           
                        </div>
</div>-->



<?php if(is_singular('blog')) { ?>


<?php if( get_field("faq_-__верхний_заголовок") ): ?>
<?php $faqSchema = ''; ?>
<div class="section-faq-home-page article">
    <div class="container">
        <div class="container-faq-home">
            <div class="faq-home-left">
                <div class="more-article-about-theme sp-h2-title"><?php the_field('faq_-__верхний_заголовок');?></div>
            </div>
            <div class="faq-home-right">
                <div class="daccordion2" id="daccordion2">
                                    
                <?php if(get_field('faq_вопрос_ответ')): ?>
                <?php while(has_sub_field('faq_вопрос_ответ')): ?>

                <?php $faqSchema .= '{
                    "@type": "Question",
                    "name": "'.get_sub_field('faq_-_вопрос').'",
                    "acceptedAnswer": {
                    "@type": "Answer",
                    "text": "'.get_sub_field('faq_-_ответ').'"
                } },'; ?>
        
                <div class="daccordion__item2">
                    <div class="daccordion__title2"><?php the_sub_field('faq_-_вопрос'); ?><div class="arrac"><svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="5.65625" y="12.728" width="10" height="2" rx="1" transform="rotate(-45 5.65625 12.728)" fill="#29292D"/><rect x="7.07031" y="0.000244141" width="10" height="2" rx="1" transform="rotate(45 7.07031 0.000244141)" fill="#29292D"/></svg> </div></div>
                    <div class="daccordion__content2"><?php the_sub_field('faq_-_ответ'); ?>
                    </div>
                </div>
            
            
                <?php endwhile; ?>
                <?php endif; ?>
                               
                <script type="application/ld+json">
                {
                "@context": "https://schema.org",
                "@type": "FAQPage",
                "mainEntity":[ 
                <?php echo rtrim($faqSchema,','); ?>
                ]
                }
                </script>                                       
                
                </div>
            </div>
        </div>
    </div>
</div>
<?php else :?>    
<?php endif; ?>



    <div class="sample-posts">  
    <div class="more-article-about-theme rubread sp-h2-title">Актуальные статьи: </div >
    <div class="list-wrap">
<?php 
    $currentPost = get_the_ID();
$currentPost = array($currentPost);
$query = new WP_Query( [ 'post__not_in' => $currentPost , 'post_type' => 'blog',    'exclude' => $GLOBALS['post']->ID, 'posts_per_page' => 7] );

while ( $query->have_posts() ) {
  $query->the_post();
?>
                              <a href="<?php the_permalink() ?>" class="link-on-more-articles" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
                            <?php
}
    ?>
    
</div>
</div>
                <?php   }
                    else {
                        ?>
                    
<?php
$categories = get_the_category($post->ID);
if ($categories) {
  $category_ids = array();
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
 
    $args=array(
      'category__in' => $category_ids, 
      'post__not_in' => array($post->ID), //Не выводить текущую запись
      'showposts'=>15, // Указываем сколько похожих записей выводить
      'caller_get_posts'=>1
    );
    $my_query = new wp_query($args);
    if( $my_query->have_posts() ) {
   ?>
   <div class="sample-posts">  
    <div class="more-article-about-theme rubread sp-h2-title">Еще услуги</div > 
    <div class="list-wrap">
                    <?php
      while ($my_query->have_posts()) {
        $my_query->the_post();
?>
      <a href="<?php the_permalink() ?>" class="link-on-more-articles" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<?php
      }
        ?>
    </div>
    </div>
                    <?php
    
    }
    wp_reset_query();
  }
?>
            <?php       }
                    ?>
  <?php 
                            wp_reset_postdata(); ?>
                </div>

                <div class="ya-share2 social-share" data-curtain data-lang="en" data-services="twitter,facebook,whatsapp,vkontakte,telegram"></div>

                <?php endwhile; endif; ?>
        
            
            <?php if(is_singular('post')) { ?>
                <?php if( get_field("faq_-__верхний_заголовок") ): ?>
                <?php $faqSchema = ''; ?>
                <div class="section-faq-home-page article">
                    <div class="container">
                        <div class="container-faq-home">
                            <div class="faq-home-left">
                                <div class="more-article-about-theme sp-h2-title"><?php the_field('faq_-__верхний_заголовок');?></div>
                            </div>
                            <div class="faq-home-right">
                                <?php if (get_field("img_for_faq")) { ?>
                                <?php $faq_img1 = get_field("img_for_faq"); ?>
                                <?php } else { ?>
                                <?php $faq_img1 = "/wp-content/uploads/2025/07/faq-opt.png"; ?>
                                <?php } ?>
                                <div class="img" style="background-image: url('<?php echo $faq_img1; ?>');"></div>
                                <div class="daccordion2" id="daccordion2">
                                                    
                                <?php if(get_field('faq_вопрос_ответ')): ?>
                                <?php while(has_sub_field('faq_вопрос_ответ')): ?>

                                <?php $faqSchema .= '{
                                    "@type": "Question",
                                    "name": "'.get_sub_field('faq_-_вопрос').'",
                                    "acceptedAnswer": {
                                    "@type": "Answer",
                                    "text": "'.get_sub_field('faq_-_ответ').'"
                                } },'; ?>
                        
                                <div class="daccordion__item2">
                                    <div class="daccordion__title2"><?php the_sub_field('faq_-_вопрос'); ?><div class="arrac"><svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="5.65625" y="12.728" width="10" height="2" rx="1" transform="rotate(-45 5.65625 12.728)" fill="#29292D"/><rect x="7.07031" y="0.000244141" width="10" height="2" rx="1" transform="rotate(45 7.07031 0.000244141)" fill="#29292D"/></svg> </div></div>
                                    <div class="daccordion__content2"><?php the_sub_field('faq_-_ответ'); ?>
                                    </div>
                                </div>
                            
                            
                                <?php endwhile; ?>
                                <?php endif; ?>
                                               
                                <script type="application/ld+json">
                                {
                                "@context": "https://schema.org",
                                "@type": "FAQPage",
                                "mainEntity":[ 
                                <?php echo rtrim($faqSchema,','); ?>
                                ]
                                }
                                </script>                                       
                                
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php else :?>    
                <?php endif; ?>
            <?php } ?>
                
                
            </div>
            
            
            
            <div class="info-page__sidebar">
                    <div class="info-page__sidebar-inner">                   
                      <div class="content-heading-list-wrapper">
                          <?php echo do_shortcode('[ez-toc]');?>
                        </div>
                    </div>     
            </div>
            
            
        </div>
    




    </div>
</section>








<?php get_footer('new'); ?>

          <script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-sidebar/3.3.1/sticky-sidebar.min.js"></script>

<script> 


        var stickySidebar = new StickySidebar('.info-page__sidebar', {
            topSpacing: 100,
            bottomSpacing: 20,
            containerSelector: '.info-page__wrapper',
            innerWrapperSelector: '.info-page__sidebar-inner'
        });
    
</script>