Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1130160

    Hello,

    I installed the plugin “Ajax Search Pro” to improve the search.

    The plugin works. But there is a problem. In the menu, the search with the plugin does not work.

    The developer writes:

    The problem is, that the menu clones search container, which basically resets the event handlers, thus it won’t work. I have constructed a custom, that checks when the icon is clicked, and tries to re-initialize the plugin, and should bypass the problem.

    Try adding this custom code to the functions.php in your theme/child theme directory.

    add_action('wp_footer', 'asp_fix_fa_icon_click');
    function asp_fix_fa_icon_click() {
      ?>
      <script>
      jQuery(function($){
        $('#menu-item-search').on('click', function(){
          setTimeout(function(){
            ASP.initialize();
          }, 500);
        });
      });
      </script>
      <?php
    } 

    Can I install the code safely? I’m a little scared to break something.

    Can I override the “new” functions.php without any problems with the old file if something goes wrong?

    best regards
    Florian

    #1130217

    Hey Florian,

    You should be able to try it out, you can simply remove it if it should break anything.

    Best regards,
    Rikard

    • This reply was modified 5 years, 2 months ago by Rikard.
    #1130478

    Perfect, it works!

    #1130482

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Problem with "Ajax Search Pro"’ is closed to new replies.