<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>
<?php
if(!defined('ABSPATH')){exit;}
$unique_id=wp_unique_id('search-form-');
...
<input type="search" name="s" class="s" id="<?php echo esc_attr($unique_id);?>" title="<?php printf(esc_attr__('Поле для ввода текста','VAB'));?>" placeholder="<?php echo esc_attr__('Текст поиска','VAB'); ?>" value="<?php echo get_search_query();?>"/>
...
<?php
/**
* The searchform.php template.
*
* Used any time that get_search_form() is called.
*
* @link https://developer.wordpress.org/reference/functions/wp_unique_id/
* @link https://developer.wordpress.org/reference/functions/get_search_form/
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
/*
* Generate a unique ID for each form and a string containing an aria-label
* if one was passed to get_search_form() in the args array.
*/
$twentytwentyone_unique_id = wp_unique_id( 'search-form-' );
$twentytwentyone_aria_label = ! empty( $args['aria_label'] ) ? 'aria-label="' . esc_attr( $args['aria_label'] ) . '"' : '';
?>
<form role="search" <?php echo $twentytwentyone_aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?> method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<label for="<?php echo esc_attr( $twentytwentyone_unique_id ); ?>"><?php _e( 'Search…', 'twentytwentyone' ); // phpcs:ignore: WordPress.Security.EscapeOutput.UnsafePrintingFunction -- core trusts translations ?></label>
<input type="search" id="<?php echo esc_attr( $twentytwentyone_unique_id ); ?>" class="search-field" value="<?php echo get_search_query(); ?>" name="s" />
<input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'twentytwentyone' ); ?>" />
</form>
<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>