Hi,
I’m following up on a post made previously by another user.
Reference: https://generatepress.com/forums/topic/search-results-excerpt/
I think I understand every in this thread except where to add the suggested code. If I were to add something that looks like this as suggested:
=========
add_filter( ‘the_excerpt’, function( $excerpt ) {
$my_custom_excerpt = get_post_meta( ‘description’, $post_id );
if ( is_search() && !empty( $my_custom_excerpt )) {
$excerpt = $my_custom_excerpt;
}
return $excerpt;
} );
=========
Where would I drop that snippet? By itself into a specific file? Replacing something else?
Not a developer by trade (obviously) but usually able to trial-end-error my way through most minor edits.
Any guidance would be appreciated.
TW