Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrea Whitmer nutsandbolts

View GitHub Profile
@nutsandbolts
nutsandbolts / (Force excerpts on Genesis search results (functons.php)
Last active Jan 9, 2019 — forked from srikat/functions.php
Forces Genesis search results to display excerpts no matter what options are chosen in the theme archive settings. Props to @srikat for this one!
View (Force excerpts on Genesis search results (functons.php)
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';
}