Skip to content

Instantly share code, notes, and snippets.

@redrambles
Created May 30, 2019 23:56
Show Gist options
  • Save redrambles/6dbd9a010160928a2e513b230ea08df0 to your computer and use it in GitHub Desktop.
Save redrambles/6dbd9a010160928a2e513b230ea08df0 to your computer and use it in GitHub Desktop.
Generic Search results template for Skillcrushstarter Theme (103)
<?php
/**
* The template for displaying search results
*
* @package WordPress
* @subpackage Skillcrush_Starter
* @since Skillcrush Starter 2.0
*/
get_header(); ?>
<?php if ( have_posts() ): ?>
<header class="page-header">
<h1 class="page-title"><?php printf( esc_html__( 'Search results for %s', 'skillcrushstarter' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header>
<?php endif; ?>
<section class="search-page">
<div class="main-content">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content-blog', get_post_format() ); ?>
<?php endwhile ?>
<?php else: ?>
<article>
<h4>No posts found!</h4>
</article>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
</section>
<div id="navigation" class="container">
<div class="left"><?php next_posts_link('&larr; <span>Older Posts</span>'); ?></div>
<div class="pagination">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
echo 'Page '.$paged.' of '.$wp_query->max_num_pages;
?>
</div>
<div class="right"><?php previous_posts_link('<span>Newer Posts</span> &rarr;'); ?></div>
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment