Skip to content

Instantly share code, notes, and snippets.

Created May 22, 2017 05:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/97426c0ae8129c32d64be0b250199c5a to your computer and use it in GitHub Desktop.
Save anonymous/97426c0ae8129c32d64be0b250199c5a to your computer and use it in GitHub Desktop.
<?php
/**
* The template for displaying search results pages.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Photomania
*/
get_header(); ?>
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'photomania' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header><!-- .page-header -->
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
/**
* Adding thumbnail to search results page.
*/
the_post_thumbnail('medium'); ?>
<div class="entry-content-wrapper">
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
</header><!-- .entry-header -->
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
</div><!-- .entry-content-wrapper -->
<footer class="entry-footer">
<?php photomania_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
<?php endwhile; ?>
<?php
/**
* Hook - photomania_action_posts_navigation.
*
* @hooked: photomania_custom_posts_navigation - 10
*/
do_action( 'photomania_action_posts_navigation' ); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</section><!-- #primary -->
<?php
/**
* Hook - photomania_action_sidebar.
*
* @hooked: photomania_add_sidebar - 10
*/
do_action( 'photomania_action_sidebar' );
?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment