Skip to content

Commit

Permalink
search header
Browse files Browse the repository at this point in the history
  • Loading branch information
billerickson committed Mar 19, 2019
1 parent 4ce1846 commit e5b72ed
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
11 changes: 0 additions & 11 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,3 @@ function ea_comment_text( $args ) {
return $args;
}
add_filter( 'comment_form_defaults', 'ea_comment_text' );

/**
* Template Hierarchy
*
*/
function ea_template_hierarchy( $template ) {
if( is_home() || is_search() )
$template = get_query_template( 'archive' );
return $template;
}
add_filter( 'template_include', 'ea_template_hierarchy' );
8 changes: 4 additions & 4 deletions inc/markup.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ function ea_archive_description_markup( $markup ) {
add_filter( 'genesis_markup_cpt-archive-description_close', 'ea_archive_description_markup' );
add_filter( 'genesis_markup_date-archive-description_open', 'ea_archive_description_markup' );
add_filter( 'genesis_markup_date-archive-description_close', 'ea_archive_description_markup' );
add_filter( 'genesis_markup_search-archive-description_open', 'ea_archive_description_markup' );
add_filter( 'genesis_markup_search-archive-description_close', 'ea_archive_description_markup' );
add_filter( 'genesis_markup_search-description_open', 'ea_archive_description_markup' );
add_filter( 'genesis_markup_search-description_close', 'ea_archive_description_markup' );

/**
* Archive Pagination markup
Expand All @@ -126,7 +126,7 @@ function ea_archive_pagination_markup( $markup ) {
*
*/
function ea_search_header_classes( $attributes ) {
$attributes['class'] = 'archive-description search-archive-description';
$attributes['class'] = 'archive-description search-description';
return $attributes;
}
add_filter( 'genesis_attr_search-archive-description', 'ea_search_header_classes' );
add_filter( 'genesis_attr_search-description', 'ea_search_header_classes' );
21 changes: 21 additions & 0 deletions search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Search Results
*
* @package EAGenesisChild
* @author Bill Erickson
* @since 1.0.0
* @license GPL-2.0+
**/

/**
* Search header
*
*/
function ea_search_header() {
do_action( 'genesis_archive_title_descriptions', 'Search Results', get_search_form( false ), 'search-description' );
}
add_action( 'genesis_before_loop', 'ea_search_header', 15 );

// Build the page using the archive template
require get_stylesheet_directory() . '/archive.php';

0 comments on commit e5b72ed

Please sign in to comment.