2021-09-28 22:25:21 +03:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* The main template file.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
get_header();?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="content">
|
|
|
|
|
|
|
|
|
|
<h1 id="mainpage-title">Поиск:</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="search-form">
|
|
|
|
|
<form action="<?php bloginfo( 'url' ); ?>" method="get">
|
|
|
|
|
<input class="search-text" type="text" name="s" placeholder="<?=$s?>" value=""/>
|
|
|
|
|
<input class="search_submit" type="submit" value="Найти"/>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
|
2021-10-10 15:16:51 +03:00
|
|
|
<?if (trim($s) !== ''):?>
|
2021-09-28 22:25:21 +03:00
|
|
|
|
|
|
|
|
<p class="search-result">По запросу «<?php
|
|
|
|
|
$allsearch = new WP_Query("s=$s&showposts=-1");
|
|
|
|
|
$key = esc_html($s, 1);
|
|
|
|
|
$count = $allsearch->post_count; _e('');
|
|
|
|
|
_e('<span class="search-terms">');
|
|
|
|
|
echo $key; _e('</span>» найдено ');
|
|
|
|
|
if ($count == 1):
|
|
|
|
|
echo $count . ' '; _e('результат');
|
|
|
|
|
else:
|
|
|
|
|
if ($count > 4):
|
|
|
|
|
echo $count . ' '; _e('результатов');
|
|
|
|
|
else:
|
|
|
|
|
echo $count . ' '; _e('результата');
|
|
|
|
|
endif;
|
|
|
|
|
endif;
|
|
|
|
|
wp_reset_query(); ?></p>
|
|
|
|
|
|
|
|
|
|
<?php if(have_posts()) :?>
|
2021-09-30 13:51:38 +03:00
|
|
|
<div class="search-card-box">
|
2021-09-28 22:25:21 +03:00
|
|
|
|
|
|
|
|
<?php while(have_posts()) : the_post();?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-30 13:51:38 +03:00
|
|
|
<div class="search-card">
|
|
|
|
|
|
|
|
|
|
<div class="search-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></div>
|
|
|
|
|
<?if ( has_post_thumbnail() ) :?>
|
|
|
|
|
<img class="search-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" width="239" alt="<?the_title();?>">
|
2021-09-28 22:25:21 +03:00
|
|
|
<?endif?>
|
2021-09-30 13:51:38 +03:00
|
|
|
<div><?the_excerpt();?></div>
|
2021-09-28 22:25:21 +03:00
|
|
|
<div class="mini-card-body">
|
|
|
|
|
<div class="news_date"><?the_time('j F Y, G:i');?></div>
|
|
|
|
|
</div>
|
2021-09-30 13:51:38 +03:00
|
|
|
|
2021-09-28 22:25:21 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php endwhile;?>
|
2021-09-30 13:51:38 +03:00
|
|
|
</div>
|
2021-09-28 22:25:21 +03:00
|
|
|
|
|
|
|
|
<?get_template_part( '/blocks/paginator');?>
|
|
|
|
|
|
|
|
|
|
|
2021-10-10 15:16:51 +03:00
|
|
|
<?php endif;?>
|
|
|
|
|
|
2021-09-28 22:25:21 +03:00
|
|
|
<?php endif;?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php get_footer(); ?>
|