Add Relevanssi 'did you mean' to Genesis Theme

To enable the Relevanssi ‘did you mean’ feature in a Genesis Theme, you can use this snippet. All you have to do is to create a search.php in your theme directory with the following content:

<?php

add_action( 'genesis_before_loop', function () {
	if ( function_exists( 'relevanssi_didyoumean' ) ) {
		relevanssi_didyoumean( get_search_query(), "<p>Did you mean: ", "</p>", 5 );
	}
} );

genesis();

If there is already a search.php file, add this lines:

add_action( 'genesis_before_loop', function () {
	if ( function_exists( 'relevanssi_didyoumean' ) ) {
		relevanssi_didyoumean( get_search_query(), "<p>Did you mean: ", "</p>", 5 );
	}
} );