Change storefront search field placeholder
-
Hi, and thanks in advance.
NOTE: NSFW site, maybe some hot images from eBooks covers, no nude but adult romance covers.Great.
I have storefront+bookshop child theme, I want to change the placeholder “Search products…”within search field (#woocommerce-product-search-field-0). No matter what I try, it seems not to affect placeholder.
I could change search width, alignment, text and border color BUT not placeholder…
here the code so far/*Align Search Bar and make text and border pink #fe00a1*/
#woocommerce-product-search-field-0 {
display:inline-block;
width:100%;
color: #fe00a1;
border: solid 1px #fe00a1;
}I also tried several PHP snippets, the best one that allowed me to change almost any text within woocomemrce is this GETTEXT filter from getText filter.
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case ‘Search products…’ :
$translated_text = __( ‘Search for contemporary romance books, series ot authors…’, ‘woocommerce’ );
break;
}
return $translated_text;
}
add_filter( ‘gettext’, ‘my_text_strings’, 20, 3 );but..yes, you guessed, it didn′t work.
How can I replace the locked, hidden, or whatever has “Search prodcuts” with “Search for contemporary romance books, series ot authors…”?? CSS, PHP, harcde HTML itself, some tip?
Thanks in advance.
webdevtestus
The page I need help with: [log in to see the link]
- The topic ‘Change storefront search field placeholder’ is closed to new replies.