Title: Replace Theme Search
Last modified: July 12, 2018

---

# Replace Theme Search

 *  [ddach69](https://wordpress.org/support/users/ddach69/)
 * (@ddach69)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/replace-theme-search/)
 * I am using the Beaver Builder Theme and child theme. The parent theme uses searchform.
   php, and I also copied the searchform.php file to the child theme.
 * When I activate the “Try to replace the theme search with Ajax Search Lite form?”
   option, it doesn’t work to replace the theme’s/child theme’s search in the header.
 * Below is the contents of the searchform.php file if that helps:
    <form method
   =”get” role=”search” action=”<?php echo esc_url( home_url( ‘/’ ) ); ?>” title
   =”<?php echo esc_attr_x( ‘Type and press Enter to search.’, ‘Search form mouse
   hover title.’, ‘fl-automator’ ); ?>”> <input type=”text” class=”fl-search-input”
   name=”s” class=”form-control” value=”<?php echo esc_attr_x( ‘Search’, ‘Search
   form field placeholder text.’, ‘fl-automator’ ); ?>” onfocus=”if (this.value 
   == ‘<?php echo esc_attr_x( ‘Search’, ‘Search form field placeholder text.’, ‘
   fl-automator’ ); ?>’) { this.value = ”; }” onblur=”if (this.value == ”) this.
   value='<?php echo esc_attr_x( ‘Search’, ‘Search form field placeholder text.’,‘
   fl-automator’ ); ?>’;”> </form>
 * —-
 * Thanks for any help you can provide!
    -  This topic was modified 7 years, 11 months ago by [ddach69](https://wordpress.org/support/users/ddach69/).

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * (@wpdreams)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/replace-theme-search/#post-10504961)
 * Hi!
 * Unfortunately I don’t think that the searchform.php is used in the header in 
   this case. If the searchform.php exists, then it is probably used somewhere elese(
   maybe in the search results page?).
    The header search is very likely hard-coded
   into a different theme file. You might have to ask the theme author where to 
   locate it. Then let me know, and I will take a look.
 * Best regards,
    Ernest M.
 *  Thread Starter [ddach69](https://wordpress.org/support/users/ddach69/)
 * (@ddach69)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/replace-theme-search/#post-10510123)
 * Hello again,
 * Here is the reply I got from Beaver Builder support:
    The dev is right that the
   BB search is hardcoded and we’re not really that familiar with Ajax Search Lite
   so we’re not really sure how compatible their plugin is with our search form.
   The BB search is invoked through a method called nav_search which is inside the
   fl-theme class found in /classes/class-fl-theme.php. The function calls the form
   found in /includes/nav_search.php. These are all the files that construct the
   search button you see in the BB theme. Try providing those to the dev and let
   me know how it goes. — —
 * Below are links to copies of the files mentioned, on Google Drive:
 * class-fl-theme.php:
    [https://drive.google.com/file/d/1wOBDq2an7ak–Ik1zDuhotz02SKCGJPc/view?usp=sharing](https://drive.google.com/file/d/1wOBDq2an7ak–Ik1zDuhotz02SKCGJPc/view?usp=sharing)
 * nav_search.php:
    [https://drive.google.com/file/d/1yLo7GcEh8aG0Aq1KLadRo7cKkfNfSh1v/view?usp=sharing](https://drive.google.com/file/d/1yLo7GcEh8aG0Aq1KLadRo7cKkfNfSh1v/view?usp=sharing)
 * Thanks in advance for any help you can provide 🙂
 * David
 *  Thread Starter [ddach69](https://wordpress.org/support/users/ddach69/)
 * (@ddach69)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/replace-theme-search/#post-10534983)
 * Hey, Ernest.
 * Just checking in to see if you saw my reply.
 * I’m really hoping you can help me make this work. I love the plugin, but really
   need the tighter integration with the header search. Once I can get this working,
   I’m ready to buy the pro version, and spread the word about this great plugin
   on my blog 🙂
 * Thanks,
    David
 *  Plugin Author [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * (@wpdreams)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/replace-theme-search/#post-10536125)
 * Hi David,
 * Sorry for the late response, I think I may have a possible solution for you. 
   The second file ‘search-nav.php’ contains a possible search form output, so I
   think that replacing it with the shortcode may do the trick.
 * I have made a modified version of the file with the included shortcode for you,
   you can find it here: [https://gist.github.com/anag0/41b5e84b44a008c06d2837385f63f223](https://gist.github.com/anag0/41b5e84b44a008c06d2837385f63f223)
 * I am not sure if that is going to work, as it seems there is a custom navigation
   script attached to the original form, but it is worth a try.
 * Best regards,
    Ernest M.
 *  Thread Starter [ddach69](https://wordpress.org/support/users/ddach69/)
 * (@ddach69)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/replace-theme-search/#post-10545746)
 * Hello again Ernest,
 * Unfortunately, that did not work. It breaks the menu and ends up producing two
   non-working search forms in the header 🙁
 * Is there anything else I can try?
 * Thanks,
    David
 *  Plugin Author [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * (@wpdreams)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/replace-theme-search/#post-10550433)
 * Hi David,
 * I think there was a minor error within the code I sent you, the last div tag 
   was not closed properly. Can you please [try it](https://gist.github.com/anag0/41b5e84b44a008c06d2837385f63f223)
   again?
 * It is still very likely that it won’t work, as I have a feeling that the nav 
   search is constructed specifically for that use case, and making changes to it
   causes the issues. It is still worth a try though.
 * Best regards,
    Ernest M.
 *  Thread Starter [ddach69](https://wordpress.org/support/users/ddach69/)
 * (@ddach69)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/replace-theme-search/#post-10558892)
 * Hi Ernest,
 * Still no joy. Now it doesn’t break the nav menu, but there are still 2 non-working
   search forms in the header.
 * Is there anything else I can try?
 * If not, is there anything you can tell me that I can pass along to the Beaver
   Builder theme dev to see if there’s some way to get your awesome search integrated
   into header?
 * Thanks,
    David
 *  Thread Starter [ddach69](https://wordpress.org/support/users/ddach69/)
 * (@ddach69)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/replace-theme-search/#post-10674290)
 * Hi Ernest,
 * Still no joy. Now it doesn’t break the nav menu, but there are still 2 non-working
   search forms in the header.
 * Is there anything else I can try?
 * If not, is there anything you can tell me that I can pass along to the Beaver
   Builder theme dev to see if there’s some way to get your awesome search integrated
   into header?
 * Thanks,
    David

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Replace Theme Search’ is closed to new replies.

 * ![](https://ps.w.org/ajax-search-lite/assets/icon-256x256.png?rev=3192672)
 * [Ajax Search Lite - Live Search & Filter](https://wordpress.org/plugins/ajax-search-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-search-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-search-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-search-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-search-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-search-lite/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [ddach69](https://wordpress.org/support/users/ddach69/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/replace-theme-search/#post-10674290)
 * Status: not resolved