Today a user mailed:
I just simply want to add a search feature on the primary menu of my site. I am using Genesis theme and Altitude Pro theme. The site is ----.com. I tried doing it myself, but nothing seems to work... that is how I found your site. I saw your tutorial. I'd really like something similar to this: theconnectionproject.org. You can see it's just a magnifying glass in the header and it expands the search when you click on it.
In this tutorial I share how a search icon can be added as the last item of Primary Navigation in Altitude Pro, which when clicked will show the search form in a smooth animated fashion. Clicking anywhere on the webpage will close the search form.
Genesis Sample 2.2.3 child theme specific steps are near the bottom.
The code below is generic and may need to be modified a little based on which theme is currently active.
Step 1
Create a file named say, global.js inside a 'js' directory under the child theme having the following code:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
This works wonderfully as is without any modification on Metro Pro. Thanks for sharing!
Thanks for sharing. Another wonderful tutorial!
Oh, this is great. Thank you!
What would I have to change if I wanted the search icon to show in the secondary navbar instead?
Oh, never mind. I found it.
Just add ‘secondary’ instead of ‘primary’ in the functions.php and adjust the css.
How did you manage to do this? In my case, when I change to secondary, the search form appears on another line and has the dot in front of it..
Hi.
Thank you,Its very useful and nice.
What about if I want to put in a Menu widget? i don’t know what I have to changue.
Any idea?
thanks!!
Just checking I looked at your test example and the search button does not work on mobile ?
What would be the best solution for this ?
Possible to add it to 2 menus at once?
Looks great, I only see a dot next to the search icon.
Hi Sridhar. Thanks so much for this and your other tutorials. Joined in a heartbeat when I saw the membership fee.
Question: how would I integrate this with the WooCommerce product search function. I want it to return products only, so the native woocommerce search would be best. I’d still like the style to be the JS dropdown, but the results to be from the woocommerce product search. I hope that helps clarify.
Thanks again!
[…] article covers implementing How to set up animated Search form in Genesis tutorial in Minimum […]
Has anyone had any luck executing this with a custom menu in the ‘Header Right Widget Area’?
https://youtu.be/jMyN8LjvB4U
this is great Sridhar thanks!
the only thing is my icon is not visible…has anyone else encountered this?
spoke too soon…omit last remark 🙂
just had to add a font-size
Hello,
Anyone get this to work in Dynamik?
I’m unable to get this to work.
What I’ve tried:
– Added the js to Dynamik Custom Options
– Removed enqueue of js and font awesome (fa is enabled in Dynamik already)
– Tried in both primary and secondary menu locations
The search icon appears, but nothing happens when clicking. Firebug Console is showing no errors.
Here you go: http://sridharkatakam.com/animated-search-form-in-dynamik/
Thank you Sridhar!
Great tutorial. How about adding Simple Social icons to the left/right of the search icon?
Try adding your desired HTML markup in a line above like this (untested): http://pastebin.com/raw.php?i=Jc9RVKyb
Hi,
Thanks for this great tutorial. It seems to work for many people.
I’ve tried it with Altitude Pro and followed the video instruction for Agency Pro.
In both I don’t get the icon but the search field with the Go button.
Any Idea?
Thanks,
Jon
Can you provide the URL?
Hi Sridhar,
Thanks for quick responding. I put the code again in the files so you can see. It looks like the style.css code has no effect.
Altitude pro: https://www.imagowijzer.nl
Agency Pro: http://www.stapcoaching.nl
Best Regards,
Jon
Sorry I had to take it away from the Altitude pro site because it took half of the screen.
I’ve made two screencaptures:
https://www.imagowijzer.nl/wp-content/uploads/2015/11/screencapture-1.jpg
https://www.imagowijzer.nl/wp-content/uploads/2015/11/screencapture-2.jpg
Best Regards,
Jon
It is working as expected. The functionality is fine. You just need to adjust the CSS.
Add this in the child theme’s style.css: http://pastie.org/pastes/10568527/text
Hi Sridhar,
Thank you very much, I really appreciate your help.
Unfortunately on the Agency Pro theme at stapcoaching.nl it still doesn’t work as it should be. When I refresh a page the search field is visible, the search icon not. When I click somewhere on the page, the search field disappears.
At the Altitude Pro theme at imagowijzer.nl there is no progress at all.
Because it seems to work for others and not for me at two different sites and themes, it looks like I’m doing something wrong. I will experiment with some css settings on an local installation in the coming Holidays. For the moment I just can’t get it to work after hours of trying.
Thanks again for your time and help,
Jon
Excellent functionality. Worked exactly as described for Altitude Pro. Great Job Sridhar.
Hi Sridhar,
Thank you for your great work.
I tried to follow your tutorial but two thing:
in firefox the box appears and no icon. In chrome appears the icon but if I click on this nothing happens.
What can be?
Do you have any advice?
PS: I have Altitude pro theme
Thank you
Stefano
Can you deactivate Genesis Palette Pro (for testing sake) and let me know when done?
Deactivated 😉
Can you send me the WP and FTP logins so I can dig in?
https://sridharkatakam.com/contact/
I sent the data 😉
Thank you
Looks and works fine in Chrome and Firefox now. Can you check?
I did not make any changes. I just logged in and visited the site in Firefox.
It was working fine in Chrome earlier as well.
Thank you Sridhar, now can check only on my iphone, and work righ. Stidharta, I think that the problem is in my browser. I explane, if for example I change something in style.css and update the browser I don’t see any change. Only after many minutes I see the modify. The same for chrome. For me is this the row of the problem. Infact, you open my site in your “clean” browser and all work right. There is a way to see in real time the modify? Ops.. Excuse me for this off topic…
Try this plugin: https://wordpress.org/plugins/stylecss-load-last-version/
Hi Sridhar. Thank you very much for your help and availability. You’re really nice and prepared.
Last thing, there is a way to disappear the search box also if I click on the magnifyng glass and not only in the out space?
Stefano
I would also really love to know this. Anybody know how to make this happen?
Bit late, but for anyone else looking in the future, you can just change the javascript from .show(slow) to .toggle(slow)
Hi Sridhar,
Thanks for the wonderful tutorial.
I used this tutorial on Atmosphere Pro theme which is missing search option. everything is working great as far a functionality is a concern.
The real concern is whenever I am pressing go button in the search box, text “Go” is getting enlarge.
You can check it on http://www.financialengineer.in/
Can you please help me to get rid of this enlargement of ‘go’ button after pressing it.
Thanks in advance.
Hi Sridhar,
thank you so much, works like a charm wirh Utility Pro from Carrie Dils as well.
Thanks for the tutorial awesome !
Would this work in whitespace pro ?
[…] because it was all thanks to a great (and timely) tutorial written by Sridhar Katakam. His post on How to Add an Animated Search Form in Genesis was exactly what I followed, with a few small styling tweaks. I was so excited when I saw that […]
Thanks for the wonderful tutorial.
When I apply step 2…I copy and paste all of the code at the bottom of the functions.php file and after I upload it to my website. I completed all of the other steps as well and my website gets an error. When I remove the code from functions.php that I added my website comes back up. Any ideas of why this would be causing an error 500? (Google Chrome)
Thank you,
Josh
Can you paste the full code of your modified and error causing functions.php at http://pastebin.com/ and give the link?
Also which child theme are you using?
Works great! But is there a way to place the search toggle to the left or right of the responsive menu in mobile?
does this work in third party themes like Aspire Pro and Guru?
[…] with the power of Google. If you want to add this cool search animation to your site head over the tutorial written by Sridhar Katakam. With some styling tweaks, the new search was Heartstone […]
[…] because it was all thanks to a great (and timely) tutorial written by Sridhar Katakam. His post on How to Add an Animated Search Form in Genesis was exactly what I followed, with a few small styling tweaks. I was so excited when I saw that […]
Anyone tried this with Infinity Pro? Following the tuts above the icon appears but nothing happens when clicked on (Chrome)?
Wow, this worked so well! Thanks!
In the Genisis Sample theme, I have to remove the `padding: 15px 23px 14px; color: #0a0a0a; background: #fff; ` from the Screen Reader Text CSS. Otherwise, when you click on the button the `input[type=”submit”]:focus` doesn’t match the form anymore. Is that ok or will it make the site less accessible?
`
.screen-reader-text:focus,
.screen-reader-shortcut:focus,
.genesis-nav-menu .search input[type=”submit”]:focus,
.widget_search input[type=”submit”]:focus {
clip: auto !important;
height: auto;
width: auto;
display: block;
font-size: 1em;
font-weight: bold;
/* padding: 15px 23px 14px;
color: #0a0a0a;
background: #fff; */
z-index: 100000; /* Above WP toolbar. */
text-decoration: none;
box-shadow: 0 0 2px 2px rgba(0,0,0,.6);
}
`
Would love to have this on Infinity Pro but using WooCommerce Product Search. Is this possible?