Search form issues

Hi,

I followed your instructions in the discussion to get a search link with icon in main menu. For that I added your modified searchform.php to my child theme. It works fine on desktop pages. But below 1100px I need to click twice on the hamburger button to see the search field. Below 676px there is no search field. How can I solve this? I use Spicepress Pro 2.8.1 with a child theme.

You will find the page under http://s779689809.online.de.

Many thanks in advance,

Andreas Berndl Güntherimageimageimage
Bildschirmfoto 2019-04-22 um 10.29.47.png
1049 x 655 - 398K
Bildschirmfoto 2019-04-22 um 10.30.48.png
806 x 643 - 317K

Comments

  • Hi,

    probably there is a problem with the toggle function in responsive mode and the code I took from wordpress.org:

    /**
     * Search icon in main menu
     */

    add_filter('wp_nav_menu_items', 'add_search_form', 10, 2);

    // Display fontawesome search icon in menus and toggle search form

    function add_search_form($items, $args) {
    if( $args->theme_location == 'primary' )
           $items .= '<li class="search"><a class="search_icon"><i class="fa fa-search"></i></a><div style="display:none;" class="spicewpsearchform">'. get_search_form(false) .'</div></li>';
           return $items;
    }

    How can I solve this? Thanks in advance,

    Andreas Bernd Günther



  • Hi, @andreasguenthet

    You have added the additional code from the WordPress. We have check and it working fine. It works in the same way the code you have added. It doesn't seem to have to click twice on the hamburger button.

    Thanks
  • Hi Imraz,

    the used code was recomended here in the discussion:
    https://support.spicethemes.com/index.php?p=/discussion/comment/1268/#Comment_1268

    As mantioned before the toggle problem occurs on mobile devices only. Clicking the search Icon closes the mobile menu. I need to click on the hamburger button again to find the search field. This is not a solution.

    How can I solve this?

    Andreas Bernd Grünther
  • On clicking the menu icon it works fine, however if you click to other than the search icon of the menu, then the menu would be close. Screenshot
Sign In or Register to comment.