Site logo

[Resolved] how to style the page search

Home Forums Support [Resolved] how to style the page search

Home Forums Support how to style the page search

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1841368
    Karsten

    Hi Friends,

    I have checked the archive but could not find a suitable solution for this two issues:

    How could I add a Search term to the page search?

    Any suggestions how I could style the page search?

    Here is the link to our page and the search bar (without search text).

    Thank you very much.

    #1841555
    Ying
    Staff
    Customer Support

    Hi Karsten,

    Not sure I fully understand your question.

    What do you mean by adding a search term to the search page? Can you explain some more?

    Or is there any example site we can be looking at?

    Let me know 🙂

    #1851201
    Karsten

    Hi Ying,

    when you use the page search it is not styled yet and also there is no word like “Search” or so.

    Please check this screenshot

    Where the red error is I want to see the German word for Search.

    Thank you for your help

    #1851284
    Leo
    Staff
    Customer Support

    Little confused as well.

    Isn’t this what you are looking for?
    https://www.screencast.com/t/76SZrLI7vE

    #1851891
    Karsten

    No, this is not what I want. Sorry, that I have problems to express my issue.

    So, I try again:

    I would like to add and see the word “Search” when someone is using the page search. Currently the word “Search” is not showing when I use the page search. When someone clicks on the search icon there should also be shown “Search”.

    I hope now I could make it clearer.

    Thank you

    #1851980
    Ying
    Staff
    Customer Support

    Do you mean the search bar input area in the navigation?
    https://www.screencast.com/t/ycPycNxmGi8

    If so, try this PHP snippet:

    add_filter( 'generate_navigation_search_output', function() {
        printf(
            '<form method="get" class="search-form navigation-search" action="%1$s">
                <input type="search" placeholder="Search" class="search-field" value="%2$s" name="s" title="%3$s" />
            </form>',
            esc_url( home_url( '/' ) ),
            esc_attr( get_search_query() ),
            esc_attr_x( 'Search', 'label', 'generatepress' ) 
        ); 
    } );

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

    #1859301
    Karsten

    Hey Ying,

    this PHP snippet I was looking for.

    But on mobile the “Search” term does not show up. Could you please help with more PHP?

    Thank you very much.

    #1859331
    Ying
    Staff
    Customer Support

    This snippet should work for both desktop and mobile.

    And I tested it on my phone, it works.

    Can you try again on a new incognito window on your phone?

    There might be some cache on your mobile browser.

    Let me know 🙂

    #1859697
    Karsten

    Yes, it works perfectly.

    Thank you for your great support.

    Best

    #1860139
    Ying
    Staff
    Customer Support

    You are welcome Karsten 🙂

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