I’m a fan of Beaver Builder, but no search on mobile? What’s up with that?!
We can easily add it back, though. You just have to add a function to your functions.php file and you’ll get a search box under the header.
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 | |
/** | |
* Add Search Box to Mobile | |
* Adds a search box to mobile, below the header. | |
* To move it above the header, change fl_after_header to fl_before_header | |
*/ | |
function bbMenuPolish_addMobileSearch(){ | |
if ( wp_is_mobile() ) { | |
get_search_form(); | |
} | |
} | |
add_action( 'fl_after_header', 'bbMenuPolish_addMobileSearch' ); |
This uses WordPress’ wp_is_mobile function to determine if we’re on mobile or not.
It’s not the perfect solution, but it’s an easy solution and it works.
If you’d like, I threw it into a plugin too.