Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

nutsandbolts commented Nov 8, 2013

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

@naomi10

This comment has been minimized.

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
You can’t perform that action at this time.