- This topic has 9 replies, 3 voices, and was last updated 4 years, 8 months ago by
Ying.
-
AuthorPosts
-
July 1, 2021 at 10:14 am #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.
July 1, 2021 at 2:37 pm #1841555Ying
StaffCustomer SupportHi 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 🙂
July 10, 2021 at 12:11 pm #1851201Karsten
Hi Ying,
when you use the page search it is not styled yet and also there is no word like “Search” or so.
Where the red error is I want to see the German word for Search.
Thank you for your help
July 10, 2021 at 3:52 pm #1851284Leo
StaffCustomer SupportLittle confused as well.
Isn’t this what you are looking for?
https://www.screencast.com/t/76SZrLI7vEJuly 11, 2021 at 8:35 am #1851891Karsten
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
July 11, 2021 at 10:36 am #1851980Ying
StaffCustomer SupportDo you mean the search bar input area in the navigation?
https://www.screencast.com/t/ycPycNxmGi8If 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/
July 17, 2021 at 11:51 am #1859301Karsten
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.
July 17, 2021 at 12:29 pm #1859331Ying
StaffCustomer SupportThis 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 🙂
July 18, 2021 at 2:50 am #1859697Karsten
Yes, it works perfectly.
Thank you for your great support.
Best
July 18, 2021 at 10:17 am #1860139Ying
StaffCustomer SupportYou are welcome Karsten 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.