[Support request] How to place icon to search field in widget?

Home Forums Support How to place icon to search field in widget?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1668745
    milan

    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

    #1668748
    milan
    #1668840
    David
    Staff
    Customer Support

    Hi there,

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

    #1668904
    milan

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

    #1668934
    David
    Staff
    Customer Support

    What issues are you having with the Flex option enabled ?

    #1669482
    milan

    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…

    #1669992
    Elvin
    Staff
    Customer Support

    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).

    A wise man once said:
    "Have you cleared your cache?"

    #1670327
    milan

    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?

    #1671043
    Tom
    Lead Developer
    Lead Developer

    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.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.