Archived topic
How can I add class to search bar !?
3 replies · Started by Stephen on March 3, 2021
Hi I brought a navigation search bar to the primary menu via Customize > Layout > Primary Navigation..
Now it has a background color which I want to get rid of, could anyone teach me how to add class to this navigation search ?
In addition, for this navigation search feature, May I know its search range? one navigation title? or all content from the site?
Reference link https://www.awesomescreenshot.com/video/2931843?key=4c7482a723538f66a1af19e3c21d22c2
Thank you,
Chris
Hi there,
the Navigation Search item has its own CSS class of search-item - heres some CSS to remove the background hover color from it and optionally add a different color to the icon:
.main-navigation .main-nav ul li.search-item:hover>a {
background-color: transparent; /* Remvoe background color on hover */
color: #f00; /* Optional - Change icon color onn hover */
}
The default search behaviour is the standard WP Search function - it will do a basic search for any Title. Content or Term....
Thanks David! I am the fan of GP!!
Glad to hear that!