Ivory Search Settings – Menu Search Settings

Ivory Search Forums Support Ivory Search Settings – Menu Search Settings

Tagged: 

Viewing 3 reply threads

You must be logged in to create new topic or reply to the topic.

  • Author
    Posts
    • #23478
      Portal InovarSaúde
      Participant
      • Topics: 1
      • Replies: 2

      Hello, I really like using this plugin for searches on my site. In short, I have several searches on my site. I have searches in Portuguese (the language of my site), searches in English, searches only for WordPress articles, searches only for pages. I have always used this plugin for searches on my WordPress sites and I really like it. However, on the site I am developing now, I am having a problem with a theme:

      In short, on my WordPress site, I have 2 languages ​​(Portuguese and English) and I used the Polylang Plugin for these translations. When I change the language version, the menus in the header and footer also change. So far, everything is fine. Within Ivory Search, there is the option “Menu search”, which is what I am using at the moment to display the search I want on my home menu. However, I would like to display another search form on my menu (English). In other words, in the plugin options, they only let me choose the locations and menus that I want to display. You want to add the search input but it doesn’t allow you to choose whether to add the search input X in location X, or to add the search input Y in location Y. I’ll leave some screenshots to explain my problem.


      So as you can see in the attachment “part 1” I have the menu search option active for 2 menus, and as you can see in the attachment “part 2” I have the search form “General Search PT) for both menus which is not what I liked :(, I would like to have for the “Menu Header” the search form “General Search PT” and for the “Menu Header EN” the search form “General Search EN”. I tried to make the change through PHP but unfortunately I couldn’t. By chance would it be possible to add the option of which search form we want to add to the Menu individually and not a single search form for all the selected Menus.

      I thank you in advance for your time.
      Thank you very much.

      Attachments:
      You must be logged in to view attached files.
    • #23490
      Ivory Search
      Keymaster
      • Topics: 0
      • Replies: 1,765

      I hope you are well today and thank you for your question.

      Currently, the Ivory Search plugin does not provide this functionality but I will consider implementing it in the future version of the plugin.

      In the meantime, you can do this by developing a custom code.

      If you are not a developer, you can consider hiring a developer to develop it. You can hire a developer from any freelance site or WordPress agency.

      You can also consider hiring me to develop it for you using the form https://ivorysearch.com/custom-work/

      Best regards,
      Ivory Search Support

      • #23492
        Portal InovarSaúde
        Participant
        • Topics: 1
        • Replies: 2

        Thanks for the reply, I understand, I realize that this option is not available in the Plugin, it would be very interesting to have it in future updates.

        As for the custom code, yes, I am a developer and I have tried some PHP alternatives but I can’t get to the Search that I have in my menu.

        In the files I attached, as you can see, I am changing the language of my website, but the code I have been trying to develop is not changing the search – In PT it should be “””Escreva o tema da sua Pesquisa””” and in EN it should be “””Write the theme of your search”””

        add_filter('wp_nav_menu_items', function ($items, $args) {
            if ($args->theme_location == 'secondary' && function_exists('pll_current_language')) {
                $lang = pll_current_language();
                $search_form = ($lang == 'pt') 
                    ? do_shortcode('[ivory-search id="10461" title="Pesquisa Geral PT"]') 
                    : do_shortcode('[ivory-search id="10462" title="Pesquisa Geral EN"]');
                $items .= '<li class="menu-item-search">' . $search_form . '</li>';
            }
            return $items;
        }, 10, 2);
        
        Attachments:
        You must be logged in to view attached files.
    • #23497
      Portal InovarSaúde
      Participant
      • Topics: 1
      • Replies: 2

      I have already managed to create a code that meets my needs, thank you for your help, for the future it would be interesting to have this option that I mentioned, I think.

      Thank you
      Good work 🙂

    • #23520
      Ivory Search
      Keymaster
      • Topics: 0
      • Replies: 1,765

      Awesome great to see you got that achieved.

      Sure, we will consider it.

      Have a fantastic day!

Viewing 3 reply threads

You must be logged in to create new topic or reply to the topic.