Brandon Nelson
asked 2 years ago

Is there a template file for the layout of search results in DW Purity? The search results look unformatted and I would like to clean them up a little and sort them out into a full width page into a grid somewhat like you have in DW Medium.

1 Answers
DominicStaff
answered 2 years ago

If you want to change the search result page, you can create a search.php file in your theme then add the following code to the file to edit it. 

<?php
/**
* The template for displaying search results pages.
*
* @package stackstar.
*/

get_header(); ?>
<div class="search-container">
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<div class="search-page-form" id="ss-search-page-form"><?php get_search_form(); ?></div>

<?php if ( have_posts() ) : ?>

<header class="page-header">
<span class="search-page-title"><?php printf( esc_html__( 'Search Results for: %s', 'dw-purity' ), '<span>' . get_search_query() . '</span>' ); ?></span>
</header><!-- .page-header -->

<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content' ); ?>
<?php endwhile; ?>

<?php dw_purity_posts_navigation(); ?>

<?php else : ?>

<?php get_template_part( 'template-parts/content', 'none' ); ?>

<?php endif; ?>

</main><!-- #main -->
</section><!-- #primary -->
</div>
<?php //get_sidebar(); ?>
<?php get_footer(); ?>
Powered by DW Question & Answer Pro