Last active
May 22, 2018 21:02
-
-
Save hostz-frank/9909e2b773167865a12b4df3f410bd37 to your computer and use it in GitHub Desktop.
Remove search field for Theme "Divi" (too close to other links: Pagespeed Insights).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove search field for Theme "Divi" (to close to other links: Pagespeed Insights). | |
* Requires the Autoptimze option "Minimize HTML" to be activated. | |
*/ | |
add_filter( 'autoptimize_html_after_minify', 'divi_remove_search' ); | |
function divi_remove_search( $content ) { | |
$content = preg_replace( | |
'/\<div class="et_search.*close_search_field"\>\<\/span\>\<\/div\>\<\/div\>/', | |
'', | |
$content | |
); | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment