- This topic has 11 replies, 6 voices, and was last updated 4 years, 8 months ago by
Leo.
-
AuthorPosts
-
July 4, 2015 at 7:19 am #118565
Pavol Juhasz
Hello!
First, thanks for this awesome theme, I got it with all the plugins and I’m really enjoying it so far!
I got a couple questions about Search widget. I like to use it instead of navigation (in menu) search, but I would like to change some things:
How can I change the background color of one widget (the search widget) without altering other sidebar widgets?
1) I tried to add background-color:transparent; to search-widget, but it didn’t work.
2) I would like to add magnifying glass right next to the search box, so people can type keywords and then click on the magnifying glass, instead of only using enter.
This two thing won’t get me any sleep π I found several good answers on other questions in this support forum, however, not to these two.
Thanks,
Pavolko
July 4, 2015 at 9:10 am #118586Tom
Lead DeveloperLead DeveloperHi Pavolko,
To make the search widget transparent, you can use this CSS:
.sidebar .widget_search { background: transparent; }
Then, to add the search icon, add this CSS:
.widget .search-field { width: 85%; } .widget_search .search-submit { background: transparent; color: inherit; display: inline-block; font-family: FontAwesome; padding: 10px 5px; } .widget_search .search-submit:hover, .widget_search .search-submit:active, .widget_search .search-submit:focus { background: transparent; color: inherit; }
Then add this PHP:
add_filter( 'generate_search_button','generate_custom_search_button' ); function generate_custom_search_button() { return ''; }
That should do it π
Adding CSS: http://generatepress.com/knowledgebase/adding-css/
Adding PHP: http://generatepress.com/knowledgebase/adding-php-functions/July 4, 2015 at 10:52 am #118625Pavol Juhasz
Working like a charm. Thx a lot π
July 4, 2015 at 9:47 pm #118693Tom
Lead DeveloperLead DeveloperNo problem π
July 22, 2016 at 12:58 am #211909Thierry
Great, thank you Tom π
July 22, 2016 at 7:31 am #211957Tom
Lead DeveloperLead DeveloperGlad I could help π
May 17, 2017 at 3:59 am #319103Edu
Hi again, im New with code, where i need to add this php code? thnks
Then add this PHP:
add_filter( ‘generate_search_button’,’generate_custom_search_button’ );
function generate_custom_search_button()
{
return ‘’;
}May 17, 2017 at 8:47 am #319167Tom
Lead DeveloperLead DeveloperThis should help: https://docs.generatepress.com/article/adding-php/
January 6, 2019 at 1:33 pm #774744Diogenes
Hi.
I need to change the word Search in the navigation widget to the magnifying glass icon.
Use the code that Tom put here, but I get only one square instead. I suppose this is due to the support of Font Awesome.
Is it possible that the icon of the magnifying glass that was displayed was the one that comes by default in the new versions of GP premium?
What would be the necessary code?
It would be lighter and without using the Awesome font to replace the word with the icon.
Thanks in advance.January 6, 2019 at 2:53 pm #774787Leo
StaffCustomer SupportAny chance you can open a new topic?
This one is a bit old with multiple authors already.
Thanks!
January 6, 2019 at 3:11 pm #774792Diogenes
Ok Leo, thanks.
January 6, 2019 at 4:03 pm #774815Leo
StaffCustomer SupportThanks π
-
AuthorPosts
- You must be logged in to reply to this topic.