Skip to content

Instantly share code, notes, and snippets.

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 nutsandbolts/7377351 to your computer and use it in GitHub Desktop.
Save nutsandbolts/7377351 to your computer and use it in GitHub Desktop.
Forces Genesis search results to display excerpts no matter what options are chosen in the theme archive settings. Props to @srikat for this one!
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';
}
@nutsandbolts
Copy link
Author

Thanks to @srikat for this - this comes up often with my clients who want full posts except in search results.

@naomi10
Copy link

naomi10 commented Jun 11, 2017

Thank you, it has helped me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment