wp-73k/search.php

46 lines
1.3 KiB
PHP
Raw Normal View History

2019-05-23 12:30:31 -04:00
<?php
/**
* The template for displaying search results pages.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package AdamPion73k
2019-05-23 12:30:31 -04:00
*/
get_header(); ?>
<main class="container d-flex justify-content-center">
<div class="col-12 col-md-10 col-lg-9 col-xl-8 col-xxl-7 pb-2 mb-4 mt-3">
2019-05-23 12:30:31 -04:00
<?php if (have_posts()) : ?>
<h1 class="text-gray-300 fst-italic mb-4 tek-border-bottom-gray-dashed">
Search results for: <?php echo esc_html( get_search_query() ); ?></h1>
2019-05-23 12:30:31 -04:00
<?php
while ( have_posts() ) :
the_post();
echo get_template_part( 'content-templates/content', 'article' );
endwhile;
?>
2019-05-23 12:30:31 -04:00
<nav class="d-flex justify-content-between" aria-label="Page navigation">
<div class="nav-previous alignleft"><?php next_posts_link( '&larr; Older' ); ?></div>
<div class="nav-next alignright"><?php previous_posts_link( 'Newer &rarr;' ); ?></div>
</nav>
2019-05-23 12:30:31 -04:00
<?php
else :
2019-05-23 12:30:31 -04:00
echo '<h1 class="text-gray-300 fst-italic mb-4 tek-border-bottom-gray-dashed">Search: nothing found</h1>';
2019-05-23 12:30:31 -04:00
printf( 'Sorry, no results for %s',
esc_html( get_search_query() )
);
endif;
?>
2019-05-23 12:30:31 -04:00
</div>
</main>
2019-05-23 12:30:31 -04:00
<?php
get_footer('', array('frontpage'=>false));