Site logo

Archived topic

How to place icon to search field in widget?

8 replies · Started by milan on February 23, 2021

Viewing posts 1–9 of 9

Hello,
Iam using GP Premium 1.12.3 and I would like to place some search icon to search field in widget in my theme.
Iam also using Fontawesome, loaded from CDN and I would like to use some of these icons or any other icon.
How to create this search field with this icon, like in this attachment?
Thanks for help.

Search field with icon

Hi there,

if you're site Customizer > General > Structure is set to Flexbox then thats how the default Search Widget will display.

Iam using Floats, because there are some problems with css styles...

What issues are you having with the Flex option enabled ?

So it is a little bit long story. But I have been moving my old theme to this one GP in my sites https://north-vietnam.com/ and https://severni-vietnam.cz/. This theme is fine, fast, everything is good, but in this process of moving to this theme, there have been various problems in my CSS (not styles in this theme). I try to change my very old theme to Flex structure in GP, but in Flex there have been various bad placing of my images, formating of texts, bad positions of images... But I tried to move to Float structure and there have been almost everything fine. Now Iam in Float structure, I tried to move this structure to Flex, and again the same problems by Css style... (e.g. different styling of images in css styles, bad position of search bar in navigation...)

Iam not sure, but what is better Flex or Float structure? Sorry Iam not a professional developer...

Hi there,

Flexbox is definitely recommended over floats as float layout method is pretty old.

The more modern way of doing layout is usually a mix of Flexbox + Grid. (Flex for content alignment, Grid for general page layout). It's definitely better in the long run over the legacy method (floats).

Ok, thanks, I will try to change it to Flexbox.
And in the Float structure it is not possible to add this icon by Fontawesome?

Hi there,

It is possible, but it would require overwriting the searchform.php template file in your child theme: https://github.com/tomusborne/generatepress/blob/3.0.2/searchform.php

That way you could add the Font Awesome icon directly into the search button. It would also require some custom CSS which we'd be happy to help with when you get the above done.

This archived topic is closed to new replies.