[Resolved] Search box on top of the featured image

Home Forums Support [Resolved] Search box on top of the featured image

Home Forums Support Search box on top of the featured image

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #561506
    Catalin

    Hi guys,

    is there any way I can do this?
    Or another solution to add the search box on top of an image.

    Thank you.

    #561868
    Leo
    Staff
    Customer Support

    Hi there,

    Do you want that on all pages?

    Let me know πŸ™‚

    #561921
    Catalin

    Hi Leo,

    the website will open with a big picture in the middle and we want to have a big and beautiful πŸ™‚ search bar on it. On the other pages the search bar will be located in a widget together with some filter options.

    #562128
    Leo
    Staff
    Customer Support

    I think the best way would be to turn search into shortcode:
    https://generatepress.com/forums/topic/search-form-within-a-page-possible/#post-280649

    Then use our page header add-on:
    https://docs.generatepress.com/article/page-header-overview/

    Let me know πŸ™‚

    #562380
    Catalin

    Hi Leo,

    what am I suppose to do with the code?

    #562549
    Leo
    Staff
    Customer Support

    Add it using one of these methods: https://docs.generatepress.com/article/adding-php/

    Code Snippets is the easiest if you aren’t using a child theme.

    #562590
    Catalin

    It worked. Thank you.

    How could I make the search box width bigger and change the “Search” word with something else (form text and button)?

    #562709
    Leo
    Staff
    Customer Support

    This CSS should work for the width:

    .page-header-content input[type=search] {
        width: 300px;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    This snippet should change the text:

    add_filter('get_search_form', 'my_search_form_text');
    function my_search_form_text($text) {
         $text = str_replace('value="Search"', 'value="CUSTOM SEARCH BUTTON TEXT"', $text); //set as value the text you want
         return $text;
    }
    #562980
    Catalin

    It worked, thanks.
    How can I change also the text from the search box (Search …)?

    #563165
    Leo
    Staff
    Customer Support
    #563202
    Catalin

    It works. Thank you, Leo.

    The search box looks very small on my mobile. Should I have a different header for mobile? Or what could I do?

    #563341
    Leo
    Staff
    Customer Support

    Try this CSS:

    @media (max-width: 768px) {
        .page-header-content-container {
            padding-left: 0;
            padding-right: 0;
        }
    }

    Let me know πŸ™‚

    #564275
    Catalin

    It worked. Thank you.

    #564354
    Catalin

    I have one more. The search box and botton are centered. How could i set the button to be align to right?

    #564597
    Leo
    Staff
    Customer Support

    You’d have to set a specific width for mobile like this:

    @media (max-width: 768px) {
        .page-header-content input[type=search] {
            width: 150px;
        }
    }
Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.