A fork of the WordPress Twenty Seventeen theme; used to power the Sandia Mesa websites.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

67 lines
1.9 KiB

  1. <?php
  2. /**
  3. * The template for displaying search results pages
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
  6. *
  7. * @package Simple_Nineteen
  8. * @since 1.0
  9. * @version 1.0.1
  10. */
  11. get_header(); ?>
  12. <div class="wrap">
  13. <header class="page-header">
  14. <?php if ( have_posts() ) : ?>
  15. <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'simplenineteen' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
  16. <?php else : ?>
  17. <h1 class="page-title"><?php _e( 'Nothing Found', 'simplenineteen' ); ?></h1>
  18. <?php endif; ?>
  19. </header><!-- .page-header -->
  20. <div id="primary" class="content-area">
  21. <main id="main" class="site-main" role="main">
  22. <?php
  23. if ( have_posts() ) :
  24. /* Start the Loop */
  25. while ( have_posts() ) :
  26. the_post();
  27. /**
  28. * Run the loop for the search to output the results.
  29. * If you want to overload this in a child theme then include a file
  30. * called content-search.php and that will be used instead.
  31. */
  32. get_template_part( 'template-parts/post/content', 'excerpt' );
  33. endwhile; // End of the loop.
  34. the_posts_pagination(
  35. array(
  36. 'prev_text' => simplenineteen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'simplenineteen' ) . '</span>',
  37. 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'simplenineteen' ) . '</span>' . simplenineteen_get_svg( array( 'icon' => 'arrow-right' ) ),
  38. 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'simplenineteen' ) . ' </span>',
  39. )
  40. );
  41. else :
  42. ?>
  43. <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'simplenineteen' ); ?></p>
  44. <?php
  45. get_search_form();
  46. endif;
  47. ?>
  48. </main><!-- #main -->
  49. </div><!-- #primary -->
  50. <?php get_sidebar(); ?>
  51. </div><!-- .wrap -->
  52. <?php
  53. get_footer();