- This topic has 15 replies, 2 voices, and was last updated 5 years, 9 months ago by David.
-
AuthorPosts
-
June 26, 2018 at 2:36 am #608706Olivier
Hi
I have test this topic without succes :
https://docs.generatepress.com/article/generate_navigation_search_output/
https://docs.generatepress.com/article/generate_search_placeholder/I have test this too :
add_filter( 'generate_navigation_search_output', 'woo_placeholder_search' ); function woo_placeholder_search() { return __( 'Ajouter au devis', 'woocommerce' ); }
Can you help me ?
Image : https://image.noelshack.com/fichiers/2018/26/2/1530005743-placeholder.png
Thank you π
Olivier
June 26, 2018 at 2:44 am #608714DavidStaffCustomer SupportHi Olivier,
the link you have provided does not work, can you edit the original topic and provide a working one?
June 26, 2018 at 2:47 am #608715OlivierHi David,
It’s OK now ?
Thank youJune 26, 2018 at 2:50 am #608717DavidStaffCustomer SupportHi Olivier its not the URL doesn’t look correct its just
dev.dev
June 26, 2018 at 3:40 am #608773Olivier^^ My site is on development… no access directly
June 26, 2018 at 3:50 am #608784DavidStaffCustomer SupportWhat is it you are trying to do? Is it adding a Placeholder? Or Filtering the Search?
June 26, 2018 at 3:53 am #608788OlivierNo just adding a Placeholder in the search bar, a text : “Que cherchez-vous ?”
June 26, 2018 at 4:00 am #608795DavidStaffCustomer SupportOk, so the code should look like this:
add_filter( 'generate_navigation_search_output', 'tu_navigation_search_placeholder' ); function tu_navigation_search_placeholder() { printf( '<form method="get" class="search-form navigation-search" action="%1$s"> <input type="search" placeholder="Que cherchez-vous ?" 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' ) ); }
You can add this to your child theme functions or use the Code Snippets Plugin link provided in here:
https://docs.generatepress.com/article/adding-php/
Add the code (and activate if using the plugin).
If it still isn’t showing then can your use the Browser Inspector on the search bar when its open and inspect the code in the console. And see whether the placeholder is correct?
June 26, 2018 at 4:17 am #608800OlivierI added the code in Functions.php but it does not work.
https://image.noelshack.com/fichiers/2018/26/2/1530011838-sans-titre-2.png
June 26, 2018 at 4:21 am #608801DavidStaffCustomer Supporthmm it’s difficult to assess without access to the site. Could you try adding the code using the Code Snippets plugin?
June 26, 2018 at 4:43 am #608811OlivierHum OK
I can give you an access if you want because I limit the plugins π
Give me your email or other.June 26, 2018 at 4:52 am #608825DavidStaffCustomer SupportYou can send login details via the account issue form here:
https://generatepress.com/contact/
Please add a link to this post in the details
June 26, 2018 at 5:12 am #608847OlivierDavid it’s work !
I must use the Editor in WordPress to modify the Functions.php, if I use the FTP and Notepad++ and save it, it’s don’t work. I don’t know why… maybe caracters invisible…
June 26, 2018 at 5:15 am #608852DavidStaffCustomer SupportHi Olivier,
glad to hear that, but unless you are using a child theme then it not recommended to directly edit the Function files, any changes will be lost when the theme is updated.
The Code Snippets plugin is really good, many GP users including myself use this for a lot of builds.
June 26, 2018 at 5:17 am #608858OlivierI use only child theme for all sites π
Ok for the plugin πThank you very much David
-
AuthorPosts
- You must be logged in to reply to this topic.