Home › Forums › Basel support forum › Change "Show Sidebar" string › Reply To: Change "Show Sidebar" string
November 22, 2019 at 9:14 am
#158349
algeorgiadis
Participant
I know that wpml can not change the wording that is why I asked how to override the standard string “show sidebar” with code in functions.php or by copying and altering the woocommerce.php file in my child theme folder.
Nevermind I created a function to alter strings.
For anyone who is interested in this here’s the function:
// Change the show sidebar tag
function my_altered_strings( $altered_text, $text, $domain ) {
switch ( $altered_text ) {
case 'Show sidebar' :
$altered_text = __( 'Show filters', 'woocommerce' );
break;
}
return $altered_text;
}
add_filter( 'gettext', 'my_altered_strings', 20, 3 );
Thank you.