search.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 Spearhead
  8. * @since 1.0.0
  9. */
  10. get_header();
  11. ?>
  12. <section id="primary" class="content-area">
  13. <main id="main" class="site-main" role="main">
  14. <?php if ( have_posts() ) : ?>
  15. <?php get_search_form(); ?>
  16. <?php
  17. // Start the Loop.
  18. while ( have_posts() ) :
  19. the_post();
  20. ?>
  21. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  22. <header class="entry-header default-max-width">
  23. <?php
  24. if ( is_sticky() && is_home() && ! is_paged() ) {
  25. printf( '<span class="sticky-post">%s</span>', _x( 'Featured', 'post', 'spearhead' ) );
  26. }
  27. the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
  28. ?>
  29. </header><!-- .entry-header -->
  30. <footer class="entry-footer default-max-width">
  31. <?php seedlet_entry_meta_footer(); ?>
  32. </footer><!-- .entry-footer -->
  33. </article><!-- #post-${ID} -->
  34. <?php
  35. // End the loop.
  36. endwhile;
  37. // Previous/next page navigation.
  38. seedlet_the_post_navigation();
  39. // If no content, include the "No posts found" template.
  40. else :
  41. get_template_part( 'template-parts/content/content-none' );
  42. endif;
  43. ?>
  44. </main><!-- #main -->
  45. </section><!-- #primary -->
  46. <?php
  47. get_footer();