flo.ei
Forum Replies Created
-
Hi Danny thanks for your answer. Yes I use WPML, really sure 😉
Problem seems to be that it is not running the function, because even if i pass the english list as a return value of all of the cases, it signs me in to the default list.I put it into the functions.php of my theme, this is correct no?
Hi Harish, No sorry I tried that already, no chance! That code comes into my functions.php right? as last entry?
thanks for your patience!
FloHi Harish, No thats sadly not working. you want me to do the following right?
function myprefix_filter_mctb_lists( $lists ) { $list_id_german_list = 'german_id'; $list_id_english_list = 'english_id'; if( defined( 'ICL_LANGUAGE_CODE') ) { switch( ICL_LANGUAGE_CODE ) { // german case 'de': $lists = array( $list_id_german_list ); break; // english case 'en': $lists = array( $list_id_english_list ); break; } } return $lists; } add_filter( 'mc4wp_lists', 'myprefix_filter_mctb_lists' );That doesn’t work, it always signs me in to the list I choose in the Top Bar settings.
thanks in advance
FloHi Harish,
I used this code: https://mc4wp.com/kb/set-lists-based-site-language/function myprefix_filter_mc4wp_lists( $lists ) { $list_id_spanish_list = '123abcdef456'; $list_id_english_list = '456defabc123'; if( defined( 'ICL_LANGUAGE_CODE') ) { switch( ICL_LANGUAGE_CODE ) { // spanish case 'es': $lists = array( $list_id_spanish_list ); break; // english case 'en': $lists = array( $list_id_english_list ); break; } } return $lists; } add_filter( 'mc4wp_lists', 'myprefix_filter_mc4wp_lists' );The problem is not to translate it, I already use WPML and it works to translate the bar, but I want to sign the users up into different lists according the language.
Thanks a lot
Flo