Archived topic
Change the "Search ..." word into a Magnifying Lens icon
5 replies · Started by Antonio on June 28, 2019
Hi I have question regarding the GeneratePress "Search" function.
In a website I have it displayed into the Top-bar and it works properly but my client would like to change the "Search ..." word int a Magnify lens icon (maybe i can use the font-awesome library?).
Is that possible? if yes can give me a hint? In the specific I would like to use the font-awesome library.
I am using GP Premium and the Child Theme
Thanks a lot :)
Hi there,
I believe this is what you are looking for:
https://docs.generatepress.com/article/generate_search_placeholder/
You can search generate_search_placeholder in this forum to see some examples.
Let me know if this helps :)
Hi,
Thanks for the answer. I tried as you said (I am using a child theme and I did the change in the functions.php file)
But is not working :(
This is what I am trying:
add_filter( 'generate_search_placeholder','lh_search_placeholder_icon' );
function lh_search_placeholder_icon()
{
return '<i class="fa fa-search" aria-hidden="true"></i>';
}
Icons can't be added as placeholders like that, unfortunately. Do you have any examples of the look your client is going for that we can see?
Maybe this will help?: https://docs.generatepress.com/article/generate_search_button/#adding-a-font-icon
