Archived topic
Search Bar Background
9 replies · Started by Sourabh on December 8, 2020
Hi David/Tom,
When someone clicks on the search icon of the header then its open to the left side but remain blank with no text, so I want to fill some text msg in the search bar and wants the menus and logo should be hidden till the time the search box is open, so how to do that in GP -
Sample url is below -
https://typer.seventhqueen.com/travel-agency/
Open the above URL and click on the search icon on the right side of the header so that you can understand what i am trying to say.
Thanks:
Hi there,
you can set the Background color of the Search form to match that of your primary nav in Customizer > Layout > Primary Nav. This will obscure the menu and logo.
This article provides the PHP Snippet to add the Search form place holder text:
https://docs.generatepress.com/article/generate_navigation_search_output/#add-a-placeholder
Thanku David, also let me know -
Should I paste the below code into my function.php (child theme) -
https://docs.generatepress.com/article/generate_navigation_search_output/#add-a-placeholder
okay i did it, i have pasted it into child theme in function.php and its seems working except my header is dark so how to change that text color of search box??
you can set the Text color of the Search form in Customizer > Layout > Primary Nav.
Ya did it but seems something is wrong, that text doesn't display in the search box, however, now I made the header white and text black -
In your Child Theme functions, move that code to the very top of all your other code. Then recheck to make sure its working.
Yes Its Working, Thanku David, you are helpful and Kind
Awesome - glad to hear that!
Welcome..