- This topic has 7 replies, 2 voices, and was last updated 5 years, 4 months ago by
Leo.
-
AuthorPosts
-
December 17, 2020 at 3:09 pm #1585050
William
Hi there,
I have a plugin that allows AJAX searches which I want to have on display in the header.It is similar to the like of this, this, and this website.
The website I am adding such code to is here.
Is there a way to do this? I would also appreciate a drop down like the above examples too for mobile.
I would like the search bar to appear to the right of the logo for desktop, before the navigation menu.
Many thanks if this is possible.
December 17, 2020 at 8:35 pm #1585224Leo
StaffCustomer SupportHi there,
Just to confirm, you’d like to add the search box here?
https://www.screencast.com/t/XpJhWPvY7CKeep in mind that positioning there would leave very little to no space when the window shrinks.
If you want to give it a shot, try adding it using the
generate_inside_navigationhook first using a hook element:
https://docs.generatepress.com/article/hooks-element-overview/And wrap it in a div like this:
<div class="custom-search-form"> search here </div>The mobile drop down option would require a custom solution that modifies the plugin’s code unfortunately.
December 18, 2020 at 5:24 am #1585737William
Thanks for that – I see the search in the desktop menu, is there a way to make it a big wider (see here).
I’m confused what you mean with little to no space when window shrinks – I’ve made the menu slightly smaller and it would help if the default search button could be removed too?
As for the mobile version, is there a way to have the search button once click show a drop down area which I can then stick a shortcode for the search plugin in, similar to this mobile version?
December 18, 2020 at 9:35 am #1586225Leo
StaffCustomer SupportYou can change the width with this CSS:
@media (min-width: 769px) { .inside-navigation div#ajaxsearchpro1_2 { width: 200px; } }it would help if the default search button could be removed too?
It can be removed in the customizer:
https://docs.generatepress.com/article/navigation-search/As for the mobile version, is there a way to have the search button once click show a drop down area which I can then stick a shortcode for the search plugin in, similar to this mobile version?
Unfortunately that would require a custom solution that modifies the output of the plugin’s search form.
December 18, 2020 at 12:17 pm #1586395William
Thank you – is it possible to move the logo further to the left and the search closer to the logo too?
December 18, 2020 at 8:18 pm #1586643Leo
StaffCustomer SupportTry this CSS:
.nav-align-right .inside-navigation { justify-content: flex-start; } .nav-align-right .navigation-branding { margin-right: 10px; } .nav-align-right .custom-search-form { margin-right: auto; }December 19, 2020 at 5:04 am #1586902William
That seems to do the job, thank you 🙂
December 19, 2020 at 1:22 pm #1587483Leo
StaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.