Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active October 14, 2017 21:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save srikat/6912382 to your computer and use it in GitHub Desktop.
Save srikat/6912382 to your computer and use it in GitHub Desktop.
Force excerpts in Search results page regardless of Content Archives themes settings in Genesis
add_action( 'genesis_before_loop', 'sk_excerpts_search_page' );
function sk_excerpts_search_page() {
if ( is_search() ) {
add_filter( 'genesis_pre_get_option_content_archive', 'sk_show_excerpts' );
}
}
function sk_show_excerpts() {
return 'excerpts';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment