[Support request] Add Search Bar to Page Hero Element

Home Forums Support [Support request] Add Search Bar to Page Hero Element

Home Forums Support Add Search Bar to Page Hero Element

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1153471
    Martin

    Hi,

    I tried looking but I couldn’t find this anywhere.

    I’m trying to add a search bar to my home page hero element.

    I’d like it to look like this:https://bestofmachinery.com/

    Is there an easy way to do this? Thanks!

    #1153477
    Leo
    Staff
    Customer Support

    Hi there,

    Try creating a shortcode for the search field using this PHP snippet here:
    https://generatepress.com/forums/topic/search-field-in-404-page/#post-787184

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Then you can add the shortcode [search_form] in the page hero content.

    Let me know if this helps πŸ™‚

    #1153703
    Martin

    Thank you, I made a plugin and added the functions into that plugin.

    Is there a way of reducing the width of the search bar? It currently stretches across the entire width of the hero header?

    Thanks again.

    #1153834
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to where i can see the search field ?
    You can edit your original topic and use the Site URL field to share the link privately.

    #1221283
    Shreedhan

    I’m trying to do the same thing. I’ve got the search form displaying but just wanted to ask the best way to format this.

    e.g. remove the search button, change the place holder text, font colour etc.

    Appreciate your help with this.

    #1221358
    Leo
    Staff
    Customer Support

    Any chance you can open a new topic and link us to the page in question?

    Thanks πŸ™‚

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