Gettext Filter issue
-
I have tried to use ‘Gettext-filter-Wordpress’ for a eCommerce site I am building, the issue is my client wants two text strings swapped around, I read through the instructions and added the code Which is show below, but I received the following error:
Fatal error: Cannot redeclare my_text_strings() (previously declared in /homepages/24/d520177130/htdocs/.pomegranate/wp-content/themes/canvas-child/functions.php:70) in /homepages/24/d520177130/htdocs/.pomegranate/wp-content/themes/canvas-child/functions.php on line 91
The code I used is as follows:-
/** * Change text strings * * @link http://codex.ww.wp.xz.cn/Plugin_API/Filter_Reference/gettext */ function my_text_strings( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'Related Products' : $translated_text = __( 'You may also like...', 'woocommerce' ); break; } return $translated_text; } add_filter( 'gettext', 'my_text_strings', 20, 3 ); /** * Change text strings * * @link http://codex.ww.wp.xz.cn/Plugin_API/Filter_Reference/gettext */ function my_text_strings( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'You may also Like...' : $translated_text = __( 'Related Products', 'woocommerce' ); break; } return $translated_text; } add_filter( 'gettext', 'my_text_strings', 20, 3 );Am I missing something here, and did I need to install a plugin? I am not a programmer so this is a little beyound my normal work area.
The topic ‘Gettext Filter issue’ is closed to new replies.