Files

32 lines
1.6 KiB
PHP

<?php get_header(); get_template_part('template-parts/breadcrumb'); ?>
<div class="main">
<div class="container">
<div class="main-content">
<div class="search-info">
<!--Sử dụng query để hiển thị số kết quả tìm kiếm được tìm thấy
Cũng như hiển thị từ khóa tìm kiếm. Từ khóa tìm kiếm cũng
có thể hiển thị được với hàm get_search_query()-->
<?php
$search_query = new WP_Query( 's='.$s.'&showposts=-1' );
$search_keyword = esc_html( $s);
$search_count = $search_query->post_count;
//var_dump( $search_query );
printf( __('Search results for <strong>%1$s</strong>. We found <strong>%2$s</strong> articles for you.', 'thanhgiang'), $search_keyword, $search_count );
?>
</div>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
thanhgiang_numeric_posts_nav();
else :
get_template_part( 'template-parts/content', 'none' );
endif; ?>
</div>
<aside class="sidebar">
<?php get_sidebar(); ?>
</aside>
</div>
</div>
<?php get_footer(); ?>