Last active
August 29, 2015 14:17
-
-
Save neilgee/5a8aa66f23a11ebfda05 to your computer and use it in GitHub Desktop.
Genesis No Results Search PAge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Genesis Framework. | |
* | |
* WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances. | |
* Please do all modifications in the form of a child theme. | |
* | |
* @package Genesis\Templates | |
* @author StudioPress | |
* @license GPL-2.0+ | |
* @link http://my.studiopress.com/themes/genesis/ | |
*/ | |
add_action( 'genesis_before_loop', 'genesis_do_search_title' ); | |
/** | |
* Echo the title with the search term. | |
* | |
* @since 1.9.0 | |
*/ | |
function genesis_do_search_title() { | |
$title = sprintf( '<div class="archive-description"><h1 class="archive-title">%s %s</h1></div>', apply_filters( 'genesis_search_title_text', __( 'Search Results for:', 'genesis' ) ), get_search_query() ); | |
echo apply_filters( 'genesis_search_title_output', $title ) . "\n"; | |
} | |
remove_action( 'genesis_loop_else', 'genesis_do_noposts' ); | |
add_action( 'genesis_loop_else', 'themeprefix_genesis_do_noposts' ); | |
function themeprefix_genesis_do_noposts() { | |
printf( '<div class="entry"><p>%s</p></div>', apply_filters( 'genesis_noposts_text', __( 'Sorry, no results matched your search, try again below.', 'genesis' ) ) ); | |
echo '<div class="wrap search-again"><h3>Search Again</h3>'; | |
get_search_form(); | |
echo '</div>'; | |
} | |
genesis(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Genesis Framework. | |
* | |
* WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances. | |
* Please do all modifications in the form of a child theme. | |
* | |
* @package Genesis\Templates | |
* @author StudioPress | |
* @license GPL-2.0+ | |
* @link http://my.studiopress.com/themes/genesis/ | |
*/ | |
add_action( 'genesis_before_loop', 'genesis_do_search_title' ); | |
/** | |
* Echo the title with the search term. | |
* | |
* @since 1.9.0 | |
*/ | |
function genesis_do_search_title() { | |
$title = sprintf( '<div class="archive-description"><h1 class="archive-title">%s %s</h1></div>', apply_filters( 'genesis_search_title_text', __( 'Search Results for:', 'genesis' ) ), get_search_query() ); | |
echo apply_filters( 'genesis_search_title_output', $title ) . "\n"; | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment