WPML > 2 languages
-
I would like to use the option to add customers to the right list, based on language.
I found this documentationThis is what I added to my funtions.php:
<?php
/**
* Tell MailChimp for WordPress to subscribe to a certain list based on the WPML language that is being viewed.
*
* Make sure to change the list ID’s to the actual ID’s of your MailChimp lists
*
* @param array $lists
* @return array $lists
*/
add_filter( ‘mc4wp_lists’, function( $lists ) {$map = array(
‘nl’ => ‘Nederlands’,
‘fr’ => ‘Frans’,
);$site_language = defined( ‘ICL_LANGUAGE_CODE’ ) ? ICL_LANGUAGE_CODE : ”;
if( isset( $map[ $site_language ] ) ) {
$list_for_language = $map[ $site_language ];
return array( $list_for_language );
}// return default lists
return $lists;
} );But than I get an error 500 when I try to use the website.
My listnames are: Nederlands and Frans.So how can I make this work?
Thanks for helping.
- The topic ‘WPML > 2 languages’ is closed to new replies.