Main Content

Beaver Builder – Add search to mobile.

Beaver Builder SearchI’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.

<?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' );

view raw
bb-search.php
hosted with ❤ by GitHub

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.

Leave a Reply