Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search box in main menu problem
- This topic has 6 replies, 2 voices, and was last updated 1 year, 8 months ago by
Ernest Marcinko.
-
AuthorPosts
-
September 9, 2024 at 11:13 am #49201
Yans
ParticipantHi,
I created a search instance for all content (posts, pages, events, projects, files) and I want to have a search box for it in the main menu.
I followed the documentation for adding a search box to the main menu but instead of a search box there is the text “Ajax Search Pro”. Nothing happens when I click this menu item.
I am using the “Max Mega Menu” plugin (https://wordpress.org/plugins/megamenu/) for the main menu.
How can I add the search box for this instance to the main menu?
Also, is it possible to have the search box represented by an icon and search box appear when clicking the icon?Thanks!
September 9, 2024 at 12:54 pm #49202Yans
ParticipantWhen I try to add the search box via the legacy method of using the shortcode, it adds the search box, settings and results all together.
I use this shortcode:
[wd_asp elements='search' id=4]
September 9, 2024 at 3:16 pm #49203Ernest Marcinko
KeymasterHi,
It could be because of the combination with the custom menu plugin, it may convert the output in some way and that may cause a bit of incompatibility.
In this case you should stick with the legacy shortcode method instead. If the menu supports custom HTML box, Gutenberg block or a shortcode box as a menu item, then definitely use that instead.
September 9, 2024 at 3:52 pm #49204Yans
ParticipantThanks.
I used the shortcode [wd_asp elements='search' id=4] as a menu item and also as a separate Divi text module, but in both cases it displayed the search box + settings block + results block.
How can I use a shortcode just for the search box, and how can it open in the page I use for displaying the settings and results?
Best,
Yan
September 10, 2024 at 1:01 pm #49213Ernest Marcinko
KeymasterHi Yan,
For that, I recommend creating a different search shortcode – on the first one you can set the settings and results to be not visible and use that one on the menu, and use the simple shortcode for that:
[wd_asp id=5]You can even duplicate the existing shortcode so you don’t have to start from scratch.
September 11, 2024 at 4:06 pm #49245Yans
ParticipantHi Ernest,
Thank you for the suggestion to use a duplicated search instance, I used it for the main menu and it is redirecting the search query to the original search page.
I managed to get the shortcode to work in the main menu by using the legacy method (with a custom link).
This ticket can be closed.
Best,
Yan
September 11, 2024 at 4:22 pm #49247Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- The topic ‘Search box in main menu problem’ is closed to new replies.