<section id="projects">
<div class="wrp">
<div class="projects-search">
<h2 class="header-sec">
РЕАЛИЗОВАННЫЕ ПРОЕКТЫ
</h2>
</div>
<div class="block-items">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="block-item <?php $categories = get_the_category(); if( $categories[0] ) { echo $categories[0]->slug; } ?>">
<?php echo get_the_post_thumbnail() ?>
<div class="block-item__info">
<p>
<?php the_title(); ?>
</p>
<a data-fancybox data-src="#project<?php the_id(); ?>" href="javascript:;"><img src="<?php echo get_template_directory_uri(); ?>/img/white-arrow.svg" alt="arrow"></a>
</div>
<div class="project-modal" style="display: none;" id="project<?php the_id(); ?>">
<div class="project-slider owl-carousel owl-theme">
<?php if ( have_rows('project-slider') ) { while ( have_rows('project-slider') ) { the_row(); ?>
<img src="<?php the_sub_field('project-slider-img'); ?>" alt="project">
<?php } } else { } ?>
</div>
<h2 class="header-sec">
<?php the_title(); ?>
</h2>
<?php the_content(); ?>
</div>
</div>
<?php endwhile; else: ?>
<p>Поиск не дал результатов.</p>
<?php endif;?>
</div>
</div>
</section>
<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ) ?>">
<input type="text" id="search" name="s" value="<?php echo get_search_query() ?>" placeholder="Название проекта">
<label><input type="submit" value="Найти"></label>
</form>
<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ) ?>">
<input type="text" id="search" name="search" value="<?php echo get_search_query() ?>" placeholder="Название проекта">
<label><input type="submit" value="Найти"></label>
</form>