ConvertPlus allows you to create language-specific popups to ensure you are serving the right audiences.
To proceed, first, you need to create a new popup for your specific language.
You’ll need the things mentioned below:
- WPML installed on your site.
- Your style ID – You can find it here in your style customizer screen – [Link]
- Your language code – WPML -> Languages -> Edit languages screen Here- [Link]
You need to add the below code to your child theme’s functions.php file,
function cp_callback_function( $display, $style_id ) {
if( $display ) {
// Replace style id with your style ID
if( $style_id == 'cp_id_75944' ) {
// get current language code
$language_code = ICL_LANGUAGE_CODE;
// replace fr with your language code
if( $language_code == 'fr' ) {
$display = true;
} else {
$display = false;
}
}
}
return $display;
}
add_filter( 'cp_target_page_settings', 'cp_callback_function', 10, 3 );
That’s all! If you face any issues with the above process, please feel free to reach out to our support. We’re always here to help.