Hi @noe_sp,
That filter will work for both the free version (this one) and the paid version so there should be no issue there. My first guess is that you accidentally copied the opening <php tag into your theme its functions.php
file.
Please start copying on line #3 until the end of the snippet as the opening tags are already in your functions.php
file, in most cases. That will more than likely fix the issue. ??
Hope that helps. If not, let me know!
PS. This is the relevant part:
/**
* 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
*/
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' );